Android Learning notes Theme Theme modification settings

Source: Internet
Author: User

(1) Layout file

<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "android:layout_width=" match_parent "android:layout_height=" Match_parent "Android:paddi ngbottom= "@dimen/activity_vertical_margin" android:paddingleft= "@dimen/activity_horizontal_margin" Android: paddingright= "@dimen/activity_horizontal_margin" android:paddingtop= "@dimen/activity_vertical_margin" tools: Context= ". Mainactivity "> <!--Normal style usage--<textview android:id=" @+id/textview2 "Android:layout_wi Dth= "Wrap_content" android:layout_height= "wrap_content" android:layout_alignleft= "@+id/textView1" and    roid:layout_below= "@+id/textview1" android:layout_margintop= "31DP" android:text= "@string/hello_world"/>        <!--custom style usage--<textview android:id= "@+id/textview1" style= "@style/codefont.red.big" android:text= "@string/hello_world"/> <Button android:id= "@+id/button1" style= "@style/buttonstyle" android:layout_alignleft= "@+id/textview2" Android:layout_centervertical= "true" android:text= "button" android:textcolor= "@color/textcolor"/&gt ;</relativelayout>

(2) Create a new XML file in values

<?xml version= "1.0" encoding= "Utf-8"? ><resources xmlns:android= "http://schemas.android.com/apk/res/ Android "> <style name=" Codefont "parent=" @android: Style/textappearance.medium "> <item name=" android:        Layout_width ">fill_parent</item> <item name=" Android:layout_height ">wrap_content</item>        <item name= "Android:typeface" >monospace</item> </style> <style name= "codefont.red" >        <item name= "Android:textcolor" > #00FF00 </item> </style> <style name= "CodeFont.RED.BIG" > <item name= "Android:textsize" >20sp</item> </style> <style name= "ButtonStyle" > <i TEM name= "Android:textcolor" > #00FF00 </item> <item name= "Android:layout_width" >wrap_content</ item> <item name= "android:layout_height" >wrap_content</item> <item name= "Android:layout_ma Rgintop ">48dp</item> <itEM name= "Android:layout_marginleft" >148dp</item> </style> <color name= "TextColor" > #ACBDEC <    /color> <!--custom theme needs to modify the Android default theme in the manifest file--<color name= "Custom_theme_color" > #b0b0ff </color> <style name= "Customtheme" parent= "Android:Theme.Light" > <item name= "Android:windowbackground" > @color /custom_theme_color</item> <item name= "Android:colorbackground" > @color/custom_theme_color</item > </style></resources>

(3) If you want to modify the Android default theme needs to be modified in the manifest file, the circled position is the place that needs to be modified


(4) Other Ask Kim can be the default without modification!


Android Learning notes Theme Theme modification settings

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.