I am on android, and testing in my physical device. I am using react-native-scrollable-tab-view. I have two tabs inside ScrollableTabView
(Following and Recommended).
<View style={styles.container}>
<HeaderMain/>
<ScrollableTabView
tabBarPosition='overlayBottom'
tabBarUnderlineColor='#2ec76e'
tabBarBackgroundColor='white'
tabBarActiveTextColor='#2ec76e'
tabBarInactiveTextColor='#99e3b8'
scrollWithoutAnimation={true}
tabBarTextStyle={{fontFamily: 'Roboto', fontSize: 15, fontWeight: 'bold'}}>
<FollowingPostPage tabLabel="Following" />
<RecommendedPostPage tabLabel="Recommended" />
</ScrollableTabView>
</View>
Inside the FollowingPostPage I have a ScrollView
which has list of posts (each post has a picture and some text)
export default class FollowingPostPage extends Component {
render() {
return(
<ScrollView style={styles.container}>
<PostCard/>
<PostCard/>
...
...
<PostCard/>
<View style={styles.toolbar_height}/>
</ScrollView>
)
}
}
Inside the RecommendedPostPage has just a text.
export default class RecommendedPostPage extends Component {
render() {
return(
<View style={{flex:1, backgroundColor: '#ecf0f1'}}>
<Text>I am from SuggestedPage!</Text>
</View>
)
}
}
The swiping between the tabs is smooth. However, the changing of tabs if very slow.
If I press the Recommended tab, or if I swipe from Following to Recommended, the swiping is smooth, and also the tabs change as soon as the page changes.
However, when I am on Recommended, and press the Following tab or swipe from Recommended to Following, the swiping is very smooth, but the tab change takes a long time, as you can see the GIF from here:
How can I solve this issue? Could you please help me figure it out? Thank you.