<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="hello world"
style="@style/style1"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="hello world"
style="@style/style2"/>
</LinearLayout>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
<style name="style1">
<item name="android:textSize">20sp</item>
<item name="android:textColor">#00d</item>
</style>
<style name="style2" parent="@style/style1">
<item name="android:background">#ee6</item>
<item name="android:padding">8dp</item>
<item name="android:textColor">#000</item>
</style>
</resources>
版权声明:本文为博主原创文章,未经博主允许不得转载。
Android样式(style)和主题(theme)资源介绍-android学习之旅(五十六)
原文地址:http://blog.csdn.net/lpjishu/article/details/46703179