tab indicator position error
when i swipe tab, the second tab position error.

import React, { PureComponent } from 'react';
import { View, StyleSheet } from 'react-native';
import { TabViewAnimated, TabBar, SceneMap } from 'react-native-tab-view'; // 0.0.69
const FirstRoute = () => <View style={[ styles.container, { backgroundColor: '#ff4081' } ]} />;
const SecondRoute = () => <View style={[ styles.container, { backgroundColor: '#673ab7' } ]} />;
export default class TabViewExample extends PureComponent {
state = {
index: 0,
routes: [
{ key: '1', title: 'Test1' },
{ key: '2', title: 'Test2' },
{ key: '3', title: 'Test3' },
{ key: '4', title: 'Test4' },
],
};
_handleIndexChange = index => this.setState({ index });
_renderHeader = (props) => {
return (
<TabBar {...props} tabStyle={{width:130}} scrollEnabled={true} />
);
}
_renderScene = SceneMap({
'1': FirstRoute,
'2': SecondRoute,
'3': FirstRoute,
'4': SecondRoute,
});
render() {
return (
<TabViewAnimated
style={styles.container}
navigationState={this.state}
renderScene={this._renderScene}
renderHeader={this._renderHeader}
onIndexChange={this._handleIndexChange}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
snap source code: https://snack.expo.io/ry4ZPrJjZ
Same, I'm having the same issue. However it seems that if I don't set an explicit width, it works. But when I do set a width, it breaks.
Yes, I am facing a similar issue. I am trying to place another action item just beside the tab navigator but on doing so the size of the active tab doesn't adjust accordingly.
Hey, I just released a new alpha 2.0.0-alpha.0 of the library. It's rewritten using react-native-gesture-handler and react-native-reanimated addresses a many platform specific bugs and performance problems. The documentation is updated as well.
Please try the new version and see if it addresses your issue. If not, please open a new issue following the issue template.