Style.xml
<Resourcesxmlns:android= "Http://schemas.android.com/apk/res/android"> <stylename= "Appbasetheme"Parent= "Android:Theme.Light"> </style> <stylename= "Apptheme"Parent= "Appbasetheme"> <!--theme Apptheme Inheritance Appbasetheme - </style> <stylename= "Jiangnanstyle"> <Itemname= "Android:layout_width">Wrap_content</Item> <Itemname= "Android:layout_height">Wrap_content</Item> <Itemname= "Android:textsize">22sp</Item> <Itemname= "Android:textcolor">#00ff00</Item> </style> <stylename= "Pangzhi"Parent= "Jiangnanstyle"> <Itemname= "Android:textsize">30sp</Item> </style> <stylename= "Pangzhi.lizhi" > <!--style name is Lizhi inheritance Pangzhi - <Itemname= "Android:textcolor">#0000ff</Item> </style> <stylename= "MyTheme"> <Itemname= "Android:background">#ff0000</Item> </style></Resources>
Activity_main.xml
<LinearLayoutxmlns: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:paddingbottom= "@dimen/activity_vertical_margin"Android:paddingleft= "@dimen/activity_horizontal_margin"Android:paddingright= "@dimen/activity_horizontal_margin"Android:paddingtop= "@dimen/activity_vertical_margin"Tools:context=". Mainactivity "android:orientation= "vertical" > <TextViewAndroid:text= "@string/hello_world"style= "@style/jiangnanstyle" /> <TextViewAndroid:text= "@string/hello_world"style= "@style/pangzhi" /> <TextViewAndroid:text= "@string/hello_world"style= "@style/pangzhi.lizhi" /> <!--Lizhi inheritance Pangzhi - <TextViewAndroid:text= "@string/hello_world"style= "@style/jiangnanstyle" /> <TextViewAndroid:text= "@string/hello_world"style= "@style/jiangnanstyle" /></LinearLayout>
Internationalization is through the system of selecting different countries before loading different languages and pictures.
android94 Styles and Themes