2017-03-19 11 views
0

アイコンを追加します。tabview for android。私のコードでは、なりますリアクトネイティブ:アンドロイド用tabBarにアイコンを追加する方法

<ScrollableTabView> 
      <View style={styles.container} tabLabel='Menu Button'> 
      </View> 
      <View style={styles.container} tabLabel='My App'> 
      </View>   
      <View style={styles.container} tabLabel='Settings'> 
      </View> 
</ScrollableTabView> 

は、私が代わりにメニューボタン設定のアイコンを持っていると思います。 tabLabelの代わりにアイコンを使用するにはどうすればよいですか?

答えて

1

私はあなたが使用していると仮定: https://github.com/skv-headless/react-native-scrollable-tab-view

をこのソリューションが動作するはずです:

<ScrollableTabView> 
    <View style={styles.container} tabLabel='android-menu'> 
    </View> 
    <View style={styles.container} tabLabel='My App'> 
    </View>   
    <View style={styles.container} tabLabel='android-settings'> 
    </View> 
</ScrollableTabView> 

アイコンの完全なリストは、ここに提供されています:

https://github.com/skv-headless/react-native-scrollable-tab-view/blob/ee5d99950fad9c4c1129d029d7bfaea130df72d1/examples/FacebookTabsExample/android/app/src/main/assets/ion.json

編集1:

この例では、テキストの代わりにtabLabelで使用するアイコンを示しています。 https://github.com/skv-headless/react-native-scrollable-tab-view/tree/master/examples/FacebookTabsExample

+0

ありがとうございます:) –

関連する問題