小编mha*_*404的帖子

如何设置Tab.Screen的背景颜色?

正如你在下面看到的,我尝试了很多方法将背景颜色设置为透明需要 UI),但都无济于事。背景像图像一样保持灰色

  <Tab.Navigator screenOptions={{
    tabBarShowLabel: false,
    swipeEnabled: false,
    tabBarShowIcon: true,
    tabBarItemStyle: { width: iconwidth },
    tabBarStyle: { backgroundColor: 'transparent', paddingBottom: 10},
    tabBarContentContainerStyle: {backgroundColor : 'transparent', display: 'flex', justifyContent: 'center', alignItems: 'center'},
    tabBarPressColor: '#3C60AA',
    tabBarIndicatorStyle: {width: iconwidth , height: 5, backgroundColor: '#3C60AA', borderRadius: 20, marginStart: iconwidth *0.61},
    lazy: true,
    lazyPlaceholder: () => <POTab_lazy/>
  }}>

    <Tab.Screen name="POTab_1" component={POTab_1} options={{ tabBarAccessibilityLabel: 'Info',tabBarIcon: ({ tintColor }) => ( <Image source={require('../../assets/icon_info.png')} style={{width: 30, height: 30 }}/>), }}/>
    <Tab.Screen name="POTab_2" component={POTab_2} options={{tabBarAccessibilityLabel: …
Run Code Online (Sandbox Code Playgroud)

javascript react-native react-navigation

3
推荐指数
1
解决办法
2907
查看次数