1, Androidmanifest.xml
Android:theme= "@style/theme.customdialog
Styles to use: @style
<?XML version= "1.0" encoding= "Utf-8"?><Manifestxmlns:android= "Http://schemas.android.com/apk/res/android" Package= "Com.fish.helloworld"Android:versioncode= "1"Android:versionname= "1.0" > <USES-SDKandroid:minsdkversion= "+"android:targetsdkversion= "+" /> <ApplicationAndroid:allowbackup= "true"Android:icon= "@drawable/ic_launcher"Android:label= "@string/app_name"Android:theme= "@style/theme.customdialog" > <ActivityAndroid:name=". Mainactivity "Android:label= "@string/title_activity_receive" > <Intent-filter> <ActionAndroid:name= "Android.intent.action.MAIN" /> <categoryAndroid:name= "Android.intent.category.LAUNCHER" /> </Intent-filter> </Activity> </Application></Manifest>
2, Styles.xml
<Resources> <!--Base application theme, dependent on API level. This theme are replaced by Appbasetheme from Res/values-vxx/styles.xml on newer devices. - <stylename= "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. - </style> <!--application theme. - <stylename= "Apptheme"Parent= "Appbasetheme"> <!--All customizations, that is, specific to a particular api-level can go. - </style> <stylename= "Theme.customdialog"Parent= "Android:style/theme.dialog"> <Itemname= "Android:windowbackground">@drawable/filled_box</Item> </style></Resources>
3, Filled_box.xml
Must be placed under the Drawable folder, no in the unrecognized
<Shapexmlns:android= "Http://schemas.android.com/apk/res/android"> <SolidAndroid:color= "#ffff8080" /> <StrokeAndroid:width= "3DP"Color= "#ffff8080" /> <CornersAndroid:radius= "3DP" /> <paddingAndroid:left= "10DP"Android:top= "10DP"Android:right= "10DP"Android:bottom= "10DP" /></Shape>