Android Custom Styles

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.