react-native-segment-controller
react-native-segment-controller copied to clipboard
How to disable user interaction for react-native-segment-controller.
Do we have something like "enabled={false}" to disable user interaction. <SegmentedControlTab values={['OPTION 1', 'OPTION 2',]} enabled={false} selectedIndex={this.state.selectedIndex} onTabPress={this.handleIndexChange} tabStyle={{ backgroundColor: 'white',marginTop: Platform.OS === 'ios' ? 15 : 10,borderColor: 'rgb(48,140,247)',height: 50,}} borderRadius={30} tabTextStyle={{ fontSize: 15,textAlign: 'left',color: 'rgb(48,140,247)',fontWeight: '500',marginBottom: 5, }} />
What do you mean by "user interaction"?
As long as you don't handle onTabPress
callback and change the selectedIndex
prop value, you can skip user interaction with the segment controller.