diff --git a/packages/rn-tester/js/examples/ScrollView/ScrollViewIndicatorInsetsExample.ios.js b/packages/rn-tester/js/examples/ScrollView/ScrollViewIndicatorInsetsExample.ios.js new file mode 100644 index 00000000000000..00d307955362fa --- /dev/null +++ b/packages/rn-tester/js/examples/ScrollView/ScrollViewIndicatorInsetsExample.ios.js @@ -0,0 +1,116 @@ +'use strict'; + +const React = require('react'); + +const { + Button, + Dimensions, + Modal, + ScrollView, + StyleSheet, + Switch, + Text, + View, +} = require('react-native'); + +class ScrollViewIndicatorInsetsExample extends React.Component< + {...}, + {| + enableAutoIndicatorInsets: boolean, + modalPresentationStyle: string, + modalVisible: boolean, + |}, +> { + state = { + enableAutoIndicatorInsets: true, + modalPresentationStyle: null, + modalVisible: false, + }; + + _setModalVisible = (modalVisible, modalPresentationStyle) => { + this.setState({ + enableAutoIndicatorInsets: true, + modalVisible, + modalPresentationStyle, + }); + }; + + _setEnableAutoIndicatorInsets = enableAutoIndicatorInsets => { + this.setState({ + enableAutoIndicatorInsets, + }); + }; + + render() { + const {height, width} = Dimensions.get('window'); + return ( + + this._setModalVisible(false)} + presentationStyle={this.state.modalPresentationStyle} + statusBarTranslucent={false} + supportedOrientations={['portrait', 'landscape']}> + + + automaticallyAdjustsScrollIndicatorInsets + this._setEnableAutoIndicatorInsets(v)} + value={this.state.enableAutoIndicatorInsets} + style={styles.switch}/> +