Android----Style

Source: Internet
Author: User

Theme: Form level, changing form style

style--<

Style: The form element level that changes the style of the specified control or layout.

New custom style and theme:1. Create a new file named Style.xml in the Res/values directory 2. Add a <resources> root node.
<resources> <style name= "Specialtext" parent= "@style/text" >     <item name= "Android:textsize" > 18sp</item>     <item name= "Android:textcolor" > #008 </item> </style></resources>

3. You can then use the Specialtext to apply Style4.item to define the name attribute, internally define the value of the style (the property of the name in item can be a string, a color represented by a 16 binary number, or a reference to another resource.) The content in 5.parent represents a custom style that inherits directly or indirectly from Android's standard style *********** use method ***********
<edittext id= "@+id/text1"    style= "@style/specialtext"    android:layout_width= "Fill_parent"    android: layout_height= "Wrap_content"    android:text= "Hello, world!"/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ and Style,theme are still in the <style>, also quoted in the same way.
<?xml version= "1.0" encoding= "Utf-8"?><resources> <style name= "Customtheme" >    <item name= " Android:windownotitle ">true</item>    <item name=" Windowframe ">@drawable/screen_frame </item>    <item name= "Windowbackground" > @drawable/screen_background_white</item>    < Item Name= "panelforegroundcolor" > #FF000000 </item>    <item name= "Panelbackgroundcolor" > #FFFFFFFF </item>    <item name= "Paneltextcolor" >panelforegroundcolor</item>    <item name= "Paneltextsize" >14</item>    <item name= "Menuitemtextcolor" >?paneltextcolor</ item>    <item name= "menuitemtextsize" >?panelTextSize</item> </style></resources>
* * location of the app resource @ symbol: Indicates that the resource for the app was previously defined (either in the previous project or in the Android frame).? Indicates that the value of the referenced resource has been defined in the current topic. You can do this by referencing the name defined in <item> (PaneltextcolorUse the color andas defined in the Panelforegroundcolor)。 This technique can only be used in XML resources. Note that theme must set the theme in the manifest----next to learn the source: http://zyfromcq.iteye.com/blog/1401710

Android----Style

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.