Android启动出现短暂黑屏或白屏解决方案

2017-06-01  本文已影响0人  空中飞客

方案一:启动的Activity中加入android:theme="@android:style/Theme.Translucent"即可
缺点:点击桌面的图标,启动app时,短暂停留在桌面中(有卡顿的感觉)
方案二:
在res/values/styles.xml 下添加:

<resources>
    <style name="AppTheme"parent="android:Theme.Light">
          <item name="android:windowBackground">@null</item>//@null黑屏  @drawable/icon放一张图片
          <item name="android:windowNoTitle">true</item> //启动界面是否显示应用名称 true不显示 false显示
    </style>
 </resources>

AndroidManifest.xml里面

 <activity android:name=".SplashActivity"
           android:label="@string/app_name"
            ...>
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
</activity>
上一篇 下一篇

猜你喜欢

热点阅读