首页 > 解决方案 > 如何将 BottomTabNavigator 的背景颜色设置为透明?不使用位置:'绝对'

问题描述

我正在尝试使我的 BottomTabNavigator 的背景透明。

我尝试将位置设置为“绝对”,这会使背景透明,但现在标签栏不再可点击。有谁知道解决方案?

tabBarOptions: {
        inactiveBackgroundColor : COLORS.TINTCOLOR,
        activeBackgroundColor: COLORS.TINTCOLOR,
        activeTintColor: COLORS.WHITE,
        inactiveTintColor: COLORS.WHITE,
        showLabel: false,
        labelStyle: {
            fontSize: 12
        },
        style: {
            borderTopWidth: 0,
            borderTopColor: COLORS.TINTCOLOR,
            height: 50,
            position: 'absolute',
            left: 0,
            right: 0,
            bottom: 0,
            backgroundColor: 'transparent',
            borderTopLeftRadius: 25,
            borderTopRightRadius: 25,
            overflow: 'hidden',
        },
    },

标签: react-navigation

解决方案


推荐阅读