File tree Expand file tree Collapse file tree 2 files changed +86
-0
lines changed Expand file tree Collapse file tree 2 files changed +86
-0
lines changed Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const React = require ( 'react' ) ;
4+
5+ const {
6+ Button,
7+ Modal,
8+ ScrollView,
9+ StyleSheet,
10+ View,
11+ } = require ( 'react-native' ) ;
12+
13+ class ScrollViewIndicatorInsetsExample extends React . Component <
14+ { ...} ,
15+ { |
16+ modalVisible : boolean ,
17+ | } ,
18+ > {
19+ state = {
20+ modalVisible : false ,
21+ } ;
22+
23+ _setModalVisible = visible => {
24+ this . setState ( { modalVisible : visible } ) ;
25+ } ;
26+
27+ render ( ) {
28+ return (
29+ < View >
30+ < Modal
31+ visible = { this . state . modalVisible }
32+ onRequestClose = { ( ) => this . _setModalVisible ( false ) }
33+ animationType = "slide"
34+ supportedOrientations = { [ 'portrait' , 'landscape' ] } >
35+ < View style = { styles . modal } >
36+ < ScrollView
37+ style = { styles . scrollView } >
38+ < View style = { styles . scrollViewContent } >
39+ < Button
40+ onPress = { ( ) => this . _setModalVisible ( false ) }
41+ title = "Close"
42+ />
43+ </ View >
44+ </ ScrollView >
45+ </ View >
46+ </ Modal >
47+ < Button
48+ onPress = { ( ) => this . _setModalVisible ( true ) }
49+ title = "Present Modal Screen with ScrollView"
50+ />
51+ </ View >
52+ ) ;
53+ }
54+ }
55+
56+ const styles = StyleSheet . create ( {
57+ modal : {
58+ flex : 1 ,
59+ } ,
60+ scrollView : {
61+ flex : 1 ,
62+ height : 1000 ,
63+ } ,
64+ scrollViewContent : {
65+ alignItems : 'center' ,
66+ backgroundColor : '#ffaaaa' ,
67+ height : 2000 ,
68+ justifyContent : 'flex-start' ,
69+ paddingTop : 200 ,
70+ } ,
71+ } ) ;
72+
73+ exports . title = 'ScrollViewIndicatorInsets' ;
74+ exports . category = 'iOS' ;
75+ exports . description =
76+ 'ScrollView indicator insets should ignore the device\'s safe area on all iOS versions.' ;
77+ exports . examples = [
78+ {
79+ title : '<ScrollView> Indicator Insets Example' ,
80+ render : ( ) : React . Node => < ScrollViewIndicatorInsetsExample / > ,
81+ } ,
82+ ] ;
Original file line number Diff line number Diff line change @@ -118,6 +118,10 @@ const ComponentExamples: Array<RNTesterExample> = [
118118 module : require ( '../examples/ScrollView/ScrollViewAnimatedExample' ) ,
119119 supportsTVOS : true ,
120120 } ,
121+ {
122+ key : 'ScrollViewIndicatorInsetsExample' ,
123+ module : require ( '../examples/ScrollView/ScrollViewIndicatorInsetsExample' ) ,
124+ } ,
121125 {
122126 key : 'SectionList-inverted' ,
123127 module : require ( '../examples/SectionList/SectionList-inverted' ) ,
You can’t perform that action at this time.
0 commit comments