React Navigation Tabs not Clickable with absolute position

有些话、适合烂在心里 提交于 2020-01-04 02:15:07

问题


I have 2 screen in react native and I wanna make the tabs navigator transparent, it works but the navigator not clickable after adding position: absolute, if I'm not using the absolute the background turning white (can't transparent)

this is my tabBarOptions

tabBarOptions: {
        showIcon: true,
        showLabel: true,
        activeTintColor: 'orange',
        inactiveTintColor: '#fff',
        style: {
            width: '100%',
            height: 60,
            backgroundColor: 'transparent',
            borderTopWidth: 0,
            position: 'absolute',
            left: 0,
            right: 0,
            bottom: 10,
        },
        tabStyle: {
            paddingTop: 20,
        },
    },

when I clicked the Create Order tab nothing happen, but if I comment the position: absolute it's perfectly work.


回答1:


Add "zIndex=1" in tab bar style

style: {
            width: '100%',
            height: 60,
            backgroundColor: 'transparent',
            borderTopWidth: 0,
            position: 'absolute',
            zIndex: 1,
            left: 0,
            right: 0,
            bottom: 10,
        },


来源:https://stackoverflow.com/questions/56161371/react-navigation-tabs-not-clickable-with-absolute-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!