最近回顾自己对Android开发,发现自己的曾近的App好多地方做的都不尽如人意,准备将一些细碎的问题总结一下,深化改革嘛......也为自己有朝一日跳槽准备一下,作为三栖程序员我可能接触的比一般程序员多一些东西,希望能够好好利用吧,闲言少叙。
<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 in
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 are NOT specific to a particular API-level can go here. -->
</style>
<span style="color:#ff0000;"> <style name="WelcomeTheme" parent="android:Theme.Light">
<item name="android:windowBackground">@drawable/welcome</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style></span>
</resources>
在app/res/values/styles.xml 添加一个独立的主题 WelcomeTheme,集成android:Theme.Light ,这段代码要手敲,挺奇怪的。
然后在AndroidManifest.xml,你第一启动的Activity添加你私有的主题即可
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.welcome"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.DeviceDefault.Light" >
<activity
<span style="color:#ff0000;">android:theme="@style/WelcomeTheme"</span>
android:name="com.example.welcome.Introduction"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.example.photoback2.MainActivity" android:label="@string/title_activity_introduction"></activity>
</application>
</manifest>