码迷,mamicode.com
首页 > 移动开发 > 详细

3.App Resources-Resource Types/Style Resource

时间:2014-11-03 16:07:38      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   io   color   ar   for   sp   div   

1. Style Resource

  A style resource defines the format and look for a UI. A style can be applied to an individual View (from within a layout file) or to an entire

    Activity or application (from within the manifest file).

//res/values
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="CustomText" parent="@style/Text">
        <item name="android:textSize">20sp</item>
        <item name="android:textColor">#008</item>
    </style>
</resources>

  xml file that applied the style to a TextView

<?xml version="1.0" encoding="utf-8"?>
<EditText
    style="@style/CustomText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Hello, World!" />

 

3.App Resources-Resource Types/Style Resource

标签:android   style   blog   io   color   ar   for   sp   div   

原文地址:http://www.cnblogs.com/iMirror/p/4071362.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!