新建一个项目
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
style="@style/submaxhis"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
style.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 第一个样式 -->
<style name="maxhis"> <!-- 为样式定义一个全局唯一的名字-->
<item name="android:textSize">18px</item> <!-- name属性的值为使用了该样式的View控件的属性 -->
<item name="android:textColor">#0000CC</item>
</style>
<!-- 继承第一个样式 -->
<style name="submaxhis" parent="@style/maxhis">
<item name="android:textColor">#FF0000</item>
</style>
<!-- 第一个主题 -->
<style name="maxhisTheme">
<item name="android:windowNoTitle">true</item> <!-- 没标题 -->
<item name="android:windowFullscreen">?android:windowNoTitle</item> <!-- 全屏显示 -->
</style>
</resources>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.buke.demo"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="SplashActivity"
android:label="@string/app_name"
android:theme="@style/maxhisTheme"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>