如何改变tabbar的位置?我希望对于许多应用程序,需要在顶部 有一个标签栏,而不是在底部...
我期待这样的事情:
<Router createReducer={reducerCreate}>
<Scene key="somekey" tabs={true}
tabBarStyle={{position:'top'}}> <== How do I do this?
# My tabs here as scenes
</Scene>
</Router>
最佳答案
因为tabBar是有绝对定位的。您必须设置 top 属性。
tabBarStyle={{top:0}}
您必须考虑状态栏的高度和导航栏的高度,以便获得正确的定位。
p.s: 我不知道你是否意识到这一点,但要避免使用内联样式。如果只是为了举例,请忽略我的建议。 :P
关于react-native-router-flux 标签栏位置顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40829462/