【问题标题】:Expokit - Splash Screen not showing on Android after upgrading to SDK 36 from SDK 32Expokit - 从 SDK 32 升级到 SDK 36 后,启动屏幕未在 Android 上显示
【发布时间】:2020-02-05 13:13:02
【问题描述】:

我目前正在处理一个被弹出到 Expokit 的项目,几周前我们将 SDK 版本从 32 升级到 SDK 36,从那时起,在 Android 设备中,app.json 中配置选项的启动画面没有显示没了。

我们首先看到的是来自splash_background.xml 的Splash 图像,它正确显示,然后我们看到的一切都是来自app.jsonbackgroundColor 的颜色。

唯一需要更改的是 splash 对象 (app.json) 中的 backgroundColor。 此外,我们使用的是 expo 中的 AppLoading,但更改或删除它不会影响任何事情。

这只是在 Android 上发生,否则在 iOS 设备上一切看起来都不错。

环境

    - "react": "~16.9.0",
    - "react-native": "0.61.4",
    - "expo": "~36.0.0",
    - "expokit": "36.0.0",

app.json

    "sdkVersion": "36.0.0",
    "androidStatusBarColor": "#002C61",
    "androidStatusBar": {},
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "cover",
      "backgroundColor": "#bc0229"
    },

splash_background.xml

    <?xml version="1.0" encoding="utf-8"?>enter code here
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">

        <item android:drawable="@color/splashBackground"/>

        <item><bitmap android:gravity="center" android:src="@drawable/splash" /></item>

    </layer-list>

【问题讨论】:

    标签: android react-native expo splash-screen


    【解决方案1】:

    在我的设备上使用adb logcat(expo 裸工作流)我有:

    W OpenGLRenderer: Bitmap too large to be uploaded into a texture (2484x4672, max=4096x4096)
    

    所以我尝试缩小我的 splashscreen_image.png... 并且它成功了。

    【讨论】:

      【解决方案2】:

      如果你替换这一行会发生什么:

      <item><bitmap android:gravity="center" android:src="@drawable/splash" /></item>
      

      有了这个:

      <item android:drawable="@drawable/splash" android:gravity="center"/>
      

      最近我遇到了一些位图未显示的问题,this post 提供了帮助。

      【讨论】:

      • 感谢您的回答。我尝试了这个解决方案,但对闪屏显示没有任何影响。可能是 SDK36 的一个 bug,因为我想我已经尝试了大部分解决方案。
      猜你喜欢
      • 1970-01-01
      • 2020-05-21
      • 2015-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多