Reputation: 187
I'm using https://github.com/react-native-community/react-native-tab-view But my problem is
I appreciate all your advice to fix my problem. Thank you
Upvotes: 1
Views: 5813
Reputation: 71
try add:
scrollEnabled
and give width in style like this:
style={{ width: 300 }}
you can read more in here: https://github.com/react-native-community/react-native-tab-view
Upvotes: 1
Reputation: 115
You need to export title at _renderLabel function....
_renderLabel = ({ route }) => (
<Text style={styles.label}>{route.title}</Text>
);
<TabBar
{...props}
scrollEnabled={true}
renderIndicator={() => null}
ref={component => this.scrollRef = component}
renderLabel={this._renderLabel}
tabStyle={styles.tab}
style={{ backgroundColor: '#284062'}}
/>
After this, you can style text :)
Upvotes: 0
Reputation: 31
<TabView
labelStyle={fontSize:12} //---------->Add this line and reduce the fontsize
navigationState={this.state}
onIndexChange={index => this.setState({ index })}
renderScene={SceneMap({
first: FirstRoute,
second: SecondRoute,
})}
/>
Upvotes: 0