美文网首页
react-native -- 手机无法沉浸式(状态栏无法透明问

react-native -- 手机无法沉浸式(状态栏无法透明问

作者: 反者道之动001 | 来源:发表于2018-11-29 17:55 被阅读53次

    在某些安卓上, 状态栏无法更改颜色问题解决。比如(华为5.0)

    比如我们有这样的代码:
    <StatusBar translucent={false} backgroundColor={Colors.red1} barStyle="light-content" />
    但是有些手机反应, 我丢!!

    解决方案:
    cd android\app\src\main\res\values
    vi styles.xml
    找到这行代码<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">, 在里面添加1行代码

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

    --解决--

    如果想要加启动图, 请看下一篇。

    --END--

    相关文章

      网友评论

          本文标题:react-native -- 手机无法沉浸式(状态栏无法透明问

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