答案 0 :(得分:1)
我找到了解决此问题的简便方法。您可以将路由器放置在视图中并设置视图的背景色。
<View style={{backgroundColor: 'red', flex: 1}}>
<Router/>
</View>
答案 1 :(得分:0)
我发现了另一个解决方法,可以删除空格,使其可以同时用于ios和android
const DEVICE_WIDTH = Dimensions.get('window').width;
const BottomTabNavigator = createBottomTabNavigator({
HomeScreenStack,
},
{
tabBarOptions: {
style:{
borderRadius:50,
backgroundColor:"tomato",
position:'absolute',
bottom: 10,
padding:10,
width: DEVICE_WIDTH -30,
left:15,
right:15,
height: 54,
alignItems:'center',
}
}
}
)
答案 2 :(得分:0)
“位置:'绝对'”为我成功了:
tabBar: {
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
borderTopWidth: 0,
elevation: 4,
backgroundColor: '#FBFBFB',
shadowRadius: 20,
shadowColor: '#000000',
shadowOpacity: 0.2,
position:'absolute'
}