1.设定主题,此主题为透明的,加入到res/values/styles.xml中:
<style name="Theme.AppStartLoadTranslucent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
</style>2.设定android启动时使用此主题,在AndroidManifest.xml中设定:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.AppStartLoadTranslucent"
>
<activity android:name=".MainActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
本文介绍如何通过修改Android项目的styles.xml及AndroidManifest.xml文件来实现应用启动时的透明主题效果。具体步骤包括定义一个透明主题并将其应用于启动Activity。
664

被折叠的 条评论
为什么被折叠?



