Swap Scroll Right In React Native

[Solved] Swap Scroll Right In React Native | Lisp - Code Explorer | yomemimo.com
Question : swap scroll right in react native

Answered by : important-ibex-fodixogqy3ae

scrollListToStart(contentWidth, contentHeight) { if (I18nManager.isRTL) { this.scrollView.scrollTo({x: contentWidth}); }
}
render() { let containerStyle = I18nManager.isRTL ? styles.RTLContainer : styles.LTRContainer; return ( <ScrollView ref={ref => this.scrollView = ref} onContentSizeChange={this.scrollListToStart.bind(this)} horizontal={true} style={[styles.buttonsContainer, containerStyle]}> {this.renderButtons()} </ScrollView> )
}
const styles = StyleSheet.create({ RTLContainer: { flexDirection: 'row-reverse' }, LTRContainer: { flexDirection: 'row' }
})

Source : https://stackoverflow.com/questions/40507675/react-native-scrollview-right-to-left | Last Update : Sun, 18 Oct 20

Answers related to swap scroll right in react native

Code Explorer Popular Question For Lisp