0
我正在使用react-native
及其第三方模塊react-native-router-flux
進行simpe應用程序,以便輕鬆處理組件導航器。如何添加標題到react-native-router-flux tabbar?
我想添加標頭組件tabs
以上,它顯示我的應用程序名稱和選定的標籤名稱。我嘗試了幾種方法,但我不知道在哪裏放置標題組件代碼。
我頂組件這樣的代碼
<Router>
<Scene key="root">
<Scene key="todoList" tabs tabBarStyle={{ top: 0, backgroundColor: '#ddd' }} tabBarIconContainerStyle={{ borderColor: '#000', borderWidth: 1}} initial>
<Scene key="first" title="First" icon={TabIcon}>
<Scene key="scarlet" component={TabComponent1} hideNavBar title="tab1" initial />
</Scene>
<Scene key="second" title="Second" icon={TabIcon}>
<Scene key="scarlet2" component={TabComponent2} hideNavBar title="tab2" initial />
</Scene>
<Scene key="third" title="Third" icon={TabIcon}>
<Scene key="scarlet3" component={TabComponent3} hideNavBar title="tab3" initial />
</Scene>
</Scene>
</Scene>
</Router>
這實際上看起來像
我想要做的就是簡單地添加上述標籤頭組件,像
如何做到這一點?請給我一個提示!我在哪裏放置代碼?
是的,我添加了自定義標頭組件到每個標籤補償。謝謝! – Juntae