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中的人脸检测(静态和动态)
  3. Android中的人脸检测(静态和动态)
  4. Android中的人脸检测(静态和动态)
  5. Android中Dialog样式的设置
  6. Android(安卓)如何将一个Activity设置成窗口样式
  7. android dialog样式
  8. Android(安卓)RadioGroup RadioButton 自定义样式------按钮式
  9. Android主题和系统样式篇(下)

随机推荐

  1. sqlserver中通过osql/ocmd批处理批量执行
  2. SQLServer 获得用户最新或前n条订单的几
  3. win2003上安装SQL2000时CD-KEY(序列号)无
  4. Sqlserver中char,nchar,varchar与Nvarcha
  5. SqlServer中批量替换被插入的木马记录
  6. sqlserver 触发器教程
  7. 将MSSQL Server 导入/导出到远程服务器教
  8. 自动备份mssql server数据库并压缩的批处
  9. sqlserver中操作主从关系表的sql语句
  10. SQL Server SQL高级查询语句小结