Style(风格):自定义的一些 View 属性集合。
styles.xml
<span style="font-size:14px;"> <style name="TextViewStyle">
<item name="android:textColor">@android:color/holo_blue_dark</item>
<item name="android:textSize">30sp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:gravity">center_horizontal</item>
</style></span>
activity_main.xml
<span style="font-size:14px;"><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" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello_world!" />
<TextView
style="@style/TextViewStyle"
android:text="TV1" />
<TextView
style="@style/TextViewStyle"
android:text="TV2" />
<TextView
android:text="TV1"
android:textColor="#ffffff"
android:textSize="15sp"
android:background="#ff00ff"
style="@style/TextViewStyle" />
</LinearLayout></span>