2017-11-30 1 views
0

enter image description hereはどのタブで複数の項目を入れて、私は上記の例のように5つのタブがあり

それらをスクロール可能にします。

タブの文字数が多すぎて、ウィンドウの幅(要素の1つが別の行になる)を超えました。タブの幅は、常にウィンドウの幅を5で割ったもの(ウィンドウの幅/ 5)です。 私のタブの要素をスクロール可能にします。を押して、スクロールしてタブ上のすべての要素を表示します。

<Tabs>コンポーネントにはnative-baseが使用されています。

<ScrollView horizontal={true}> 
    <Tabs initialPage={0} 
      tabBarUnderlineStyle={styles.tabBarUnderlineStyle}> 
      <Tab 
      heading="FirstTab" 
      tabStyle={styles.tabStyle} 
      activeTabStyle={styles.activeTabStyle} 
      activeTextStyle={styles.activeTextStyle} 
      textStyle={styles.textStyle}> 
      <FirstScreen clothes={this.props.tops} navigation={this.props.navigation}/> 
      </Tab> 
      <Tab 

私は<FirstScreen>がこの作品<ScrollView>

let styles = RkStyleSheet.create(theme => ({ 
    tabStyle : { 
    backgroundColor: 'white', 
    justifyContent: 'center', 
    width: 60, <---- This doesn't work either. It is always (window width)/5 
    height: 40 
    }, 

答えて

0

によってラップされているので、私は水平<ScrollView>を使用することはできませんと思います!!

 <Tabs initialPage={0} 
     tabBarUnderlineStyle={styles.tabBarUnderlineStyle} 
     renderTabBar={()=> <ScrollableTab style={{height:40}}/>}> 
関連する問題