简体   繁体   English

如何在 react-navigation 5 中设置背景颜色

[英]How can I set the background color in react-navigation 5

I am using react-navigation @5.0.0 and I have added a background color to my root <View /> .我正在使用react-navigation @5.0.0 并为我的根<View />添加了背景颜色。

It seems that another view created by react-navigation is having some background color set, because I can't see my background.似乎由 react-navigation 创建的另一个视图设置了一些背景颜色,因为我看不到我的背景。 (Just as an example, I Can see the dark background when I use react-router) (举个例子,当我使用 react-router 时,我可以看到深色背景)

How can I set the background color of a page using react-navigation v5如何使用 react-navigation v5 设置页面的背景颜色

I know it's late, but I'll leave it to you just in case.我知道已经晚了,但我会把它留给你以防万一。

It is a matter of Expo from what I have managed to investigate.从我设法调查的情况来看,这是世博会的问题。 Expo does not have support for changing (as far as I have found information) the root view color for Android and iOS from Expo without Ejecting your project. Expo 不支持从 Expo 更改(据我所知)Android 和 iOS 的根视图颜色而不弹出您的项目。 Apparently to be able to modify that, it is required to use the command eject and alter said behavior in Android and iOS projects on ther respective languages and supported features.显然,为了能够修改它,需要在各自的语言和支持的功能上使用命令eject并改变 Android 和 iOS 项目中的所述行为。 There is a workaround with Expo but personally it is not practical at all Expo 有一种解决方法,但就个人而言,它根本不实用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 react-navigation v5 设置初始状态以将屏幕包含为历史记录? - How can I set the initial state using react-navigation v5 to include screens as history? 如何使用Stack Actions在反应导航中重置路线? - How I can reset route in react-navigation with Stack Actions? 我如何知道我在 react-navigation 5 中的当前路线? - How can I know my current route in react-navigation 5? 如何在 react-navigation navigationOptions 上设置功能? - How set function on react-navigation navigationOptions? 如何在 React Navigation 5 中动态设置导航栏标题和背景颜色 - How to set the navigation bar title and background color dynamically in React Navigation 5 我如何知道我是否已经使用选项卡导航(反应导航)离开了屏幕? - How can I know if I leave the screen already with tab navigation (react-navigation)? react-navigation:如何根据当前选项卡更改tabBar颜色 - react-navigation: How to change tabBar color based on current tab 我如何在 react-router-dom 中像 react-navigation 一样获得“previous”? - How in react-router-dom can I get the `previous` as in react-navigation? 在反应导航中,如何防止 AppBar 固定在顶部? 我希望它在滚动时消失 - in react-navigation, how can I prevent the AppBar to be fixed top ? I want it to disappear when I scroll react-navigation如何设置与动画值对应的tabBar边距 - react-navigation How to set tabBar margin corresponding to Animated Value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM