1

我正在尝试在启动之前删除白屏,所以我遵循了这些链接中提到的解决方案

如何修复应用程序启动时的白屏?

闪屏前的白屏

我尝试了这里提到的几乎所有解决方案

其中包括将活动主题更改为此

 android:theme="@android:style/Theme.Translucent.NoTitleBar"

或将此添加到我的主题

<item name="android:windowDisablePreview">true</item>

但是实现任何这些都会在单击应用程序图标后冻结 UI 一段时间,之后一切正常。

有没有人成功地解决了这个滞后。任何帮助将不胜感激。

4

3 回答 3

0

以下更改在 Mac 上对我有用:

1.Goto android studio preferences.
2.In Build,Execution and Deployment select "Instant run".
3.disable-Enable instant run to hot swap code/resource changes on deploy.
4.apply changes,clean project and rebuild again.
于 2016-08-08T07:07:35.283 回答
0

创建一个自定义主题,例如,

 //splashTheme
 //create in styles
 <style name="splashTheme" parent="AppTheme">
    <!-- Customize your theme here. -->

    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>

</style>

然后按如下方式应用主题,

 //manifest file
 <activity
        android:name=".SplashActivity"

        android:theme="@style/AppTheme.splashTheme"
        android:windowSoftInputMode="adjustResize|stateHidden" />

尝试这个。

于 2016-08-08T06:29:20.457 回答
0

终于以正确的方式得到了我的答案闪屏。我只是跟随。

在 values-->styles.xml 我创建了启动画面背景图像

<style name="Splash" parent="AppTheme.NoActionBar">
    <item name="android:windowBackground">@drawable/splash</item>
</style>

对于低于 api 19,在 values-19->styles.xml 我使用

<style name="Splash" parent="AppTheme.NoActionBar">
    <item name="android:windowBackground">@drawable/splash</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
</style>

我从 SplashActivity 中删除了 setContentview() 并在 Manifest.xml 文件 android:theme="@style/Splash" 中添加了启动画面的样式

于 2018-03-26T08:46:23.113 回答