gpt4 book ai didi

react-native - 转换到新屏幕时白色闪烁,背景是深色?

转载 作者:行者123 更新时间:2023-12-04 04:29:09 25 4
gpt4 key购买 nike

在使用两个不同的导航器从一个屏幕转换到另一个屏幕时,我遇到了这种情况:ex-navigation 和新的 React Navigation
.有白色闪烁一秒钟(或半秒钟)。在寻找解决方案时,我发现其他导航器也有同样的问题。例如来自 wix 的导航器
HERE。从链接:

Ok, the problem is, that React styles applies after the navigation started, and by default the backgroundColor is white, so this is the flicker effect..



有人有同样的问题吗?

最佳答案

我通过在 React-Navigation v5 的 NavigationContainer 中设置属性解决了白色闪烁问题。

<NavigationContainer theme={{ colors: { background: '#000' } }}>
{...}
</NavigationContainer>
它帮助我消除了白色闪烁,因为我更新了与背景颜色 BLACK 相同的颜色。
https://github.com/software-mansion/react-native-screens/issues/380#issuecomment-748038449

关于react-native - 转换到新屏幕时白色闪烁,背景是深色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42408034/

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