gpt4 book ai didi

ios - 我如何在 ios 上将 react-native 主题更改为 transaperent

转载 作者:行者123 更新时间:2023-11-28 21:13:34 24 4
gpt4 key购买 nike

我如何更改 ios 的主题或默认背景颜色.. 它与我的背景图像冲突。我想将其设置为透明..谢谢enter image description here

最佳答案

首先让我们了解一下react-native-router-flux中的场景是如何工作的。当您在导航器中定义它们时,如下所示,

<Scene sceneStyle={{marginTop: 64}} title="Home" key="home" component={Home} />

您只是说,我的内容应该呈现在预定义的导航栏下方。根据您的操作系统,可以是 54 位或 64 位。所以当你使用 Router 时,

<Router navigationBarStyle={{backgroundColor: 'transparent'}}>

并通过引入该行将 navigationBarStyle 添加到您拥有的每个场景,您几乎忘记了上面所做的事情,将您的场景设置为在导航栏下方对齐一些边距。因此,您在模拟器中看不到任何东西(空白)。

为了获得您需要的东西,请在您希望图像显示全屏并带有导航控件的位置执行此操作:

 Actions.refresh({
key: 'home',
navigationBarStyle: {backgroundColor: 'transparent'},
sceneStyle: {marginTop: 0},
});

或者您可以在您定义它的场景组件中引入此设置。

我测试了这个解决方案,它可以在 iOS 上运行,不能告诉 Android 相同,所以请在进行更改之前备份您的代码。您可以进一步自定义它以删除 borderBottom 线。

sample screenshot

关于ios - 我如何在 ios 上将 react-native 主题更改为 transaperent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42313184/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com