1、AndroidManifest.xml

android:theme="@style/Theme.CustomDialog

样式要用:@style

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="com.fish.helloworld"    android:versionCode="1"    android:versionName="1.0" >    <uses-sdk        android:minSdkVersion="17"        android:targetSdkVersion="17" />    <application        android:allowBackup="true"        android:icon="@drawable/ic_launcher"        android:label="@string/app_name"        android:theme="@style/Theme.CustomDialog" >        <activity            android:name=".MainActivity"            android:label="@string/title_activity_receive" >             <intent-filter>                <action android:name="android.intent.action.MAIN" />                                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>    </application></manifest>

2、styles.xml

<resources>    <!--        Base application theme, dependent on API level. This theme is replaced        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.    -->    <style name="AppBaseTheme" parent="android:Theme.Light">        <!--            Theme customizations available in newer API levels can go in            res/values-vXX/styles.xml, while customizations related to            backward-compatibility can go here.        -->    </style>    <!-- Application theme. -->    <style name="AppTheme" parent="AppBaseTheme">        <!-- All customizations that are NOT specific to a particular API-level can go here. -->    </style>        <style name="Theme.CustomDialog" parent="android:style/Theme.Dialog">        <item name="android:windowBackground">@drawable/filled_box</item>    </style></resources>


3、filled_box.xml

一定放在drawable文件夹下,否在不识别

<shape xmlns:android="http://schemas.android.com/apk/res/android">    <solid android:color="#ffff8080" />    <stroke android:width="3dp" color="#ffff8080" />    <corners android:radius="3dp" />    <padding android:left="10dp" android:top="10dp"        android:right="10dp" android:bottom="10dp" /></shape>

更多相关文章

  1. button selector 样式
  2. Android中Dialog样式的设置
  3. Android主题和系统样式篇(下)
  4. 三十三、Android给ListView设置分割线Divider样式
  5. Android给ListView设置分割线Divider样式
  6. android dialog样式
  7. Android RadioGroup RadioButton 自定义样式------按钮式
  8. Android Style样式的定义

随机推荐

  1. android api (83) —— InputMethodSessi
  2. Android学习笔记——各种常用布局管理器
  3. Android(安卓)蓝牙开发(四)OPP传输文件
  4. 基于MQTT实现Android消息推送(Push)(2)
  5. android 有关怎么自己添加系统级服务 jav
  6. Android 网络(四) Retrofit学习笔记
  7. Android UI Operation in Thread
  8. Android快速开发框架介绍
  9. 百度Android开发面试题
  10. Android 五子棋开发经验