650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/49/48/wKioL1QSXNTSRGnmAABByKgk1Lo481.jpg "title=" Style.jpg "alt=" Wkiol1qsxntsrgnmaabbykgk1lo481.jpg "/>
Style.xml
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
By Appbasetheme from Res/values-vxx/styles.xml on newer devices.
-
<style name= "Appbasetheme" parent= "Android:Theme.Light" >
<!--
Theme customizations available in newer API levels can go
Res/values-vxx/styles.xml, while customizations related to
Backward-compatibility can go here.
-
</style>
<!--application theme. -
<style name= "Apptheme" parent= "Appbasetheme" >
<!--all customizations that is not specific to a particular api-level can go. -
</style>
<style name= "Style_1" >
<item name= "Android:textsize" >16sp</item>
<item name= "Android:textcolor" > #fd8d8d </item>
</style>
<style name= "Style_2" >
<item name= "Android:textsize" >20sp</item>
<item name= "Android:textcolor" > #fd8d8d </item>
<item name= "Android:fromalpha" >0.0</item>
<item name= "Android:toalpha" >0.0</item>
</style>
</resources>
Activity_main.xml
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Vertical" >
<textview
Android:id= "@+id/text_1"
style= "@style/style_1"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:text= "@string/hello_world"/>
<textview
Android:id= "@+id/text_2"
style= "@style/style_2"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:text= "@string/hello_world"/>
</LinearLayout>
Android Style.xml