美文网首页
Android启动出现短暂黑屏或白屏解决方案

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

作者: 空中飞客 | 来源:发表于2017-06-01 16:12 被阅读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>

相关文章

网友评论

      本文标题:Android启动出现短暂黑屏或白屏解决方案

      本文链接:https://www.haomeiwen.com/subject/uddefxtx.html