@@ -23,8 +23,10 @@ export function ScrollViewKeyboardInsetsExample() {
23
23
const [ automaticallyAdjustKeyboardInsets , setAutomaticallyAdjustKeyboardInsets ] = React . useState ( true ) ;
24
24
const [ flatList , setFlatList ] = React . useState ( false ) ;
25
25
const [ inverted , setInverted ] = React . useState ( false ) ;
26
+ const [ heightRestricted , setHeightRestricted ] = React . useState ( false ) ;
26
27
27
28
const scrollViewProps = {
29
+ style : heightRestricted && styles . scrollViewHeightRestricted ,
28
30
contentContainerStyle : styles . scrollViewContent ,
29
31
automaticallyAdjustKeyboardInsets : automaticallyAdjustKeyboardInsets ,
30
32
keyboardDismissMode : 'interactive' ,
@@ -67,6 +69,13 @@ export function ScrollViewKeyboardInsetsExample() {
67
69
style = { styles . controlSwitch } />
68
70
</ View >
69
71
) }
72
+ < View style = { styles . controlRow } >
73
+ < Text > < Text style = { styles . code } > HeightRestricted</ Text > is { heightRestricted + '' } </ Text >
74
+ < Switch
75
+ onValueChange = { v => setHeightRestricted ( v ) }
76
+ value = { heightRestricted }
77
+ style = { styles . controlSwitch } />
78
+ </ View >
70
79
< View style = { styles . controlRow } >
71
80
< TextInput placeholder = { 'Text input outside scroll view' } style = { styles . controlTextInput } />
72
81
</ View >
@@ -94,6 +103,11 @@ const styles = StyleSheet.create({
94
103
alignItems : 'stretch' ,
95
104
justifyContent : 'flex-start' ,
96
105
} ,
106
+ scrollViewHeightRestricted : {
107
+ marginVertical : 50 ,
108
+ borderColor : '#f00' ,
109
+ borderWidth : 1 ,
110
+ } ,
97
111
scrollViewContent : {
98
112
paddingVertical : 5 ,
99
113
paddingHorizontal : 10 ,
0 commit comments