Scroll View inside view not working react native

后端 未结 8 1980
渐次进展
渐次进展 2021-02-07 00:31

Here I am trying a simple code but the scroll view is not working if kept inside another view. Code is like this:

  return(
  
    

        
相关标签:
8条回答
  • 2021-02-07 01:11

    Top <View> must has style flex:1, and also <ScrollView> has too

    0 讨论(0)
  • 2021-02-07 01:11

    Update 2020-02: It will work with React.Fragment <> and </> or <React.Fragment> and </React.Fragment>. So Try this.

    return(
      <>
        <Toolbar title={this.props.title}>
        </Toolbar>
    
        <ScrollView>
    
          <HomeScreenTop />
          <HomeScreenBottom navigator={navigator}/>
    
        </ScrollView>
    
      </>
     );
    
    0 讨论(0)
  • 2021-02-07 01:12

    If you are using <Form> from native base and you want to scroll then use KeyboardAwareScrollView

    <KeyboardAwaareScrollView enableOnAndroid={true}>
    .
    .
    
    </KeyboardAwareScrollView>
    

    this will work on Android

    0 讨论(0)
  • 2021-02-07 01:13

    For me, Scroll View wrapped with TouchableWithoutFeedback was causing scroll view to not function at times.

    0 讨论(0)
  • 2021-02-07 01:17

    if you are using position: "absolute", delete it and try. You can try

    <SafeAreaView>
    
    <ScrollView>
    
    </ScrollView>
    
    </SafeAreaView>
    
    0 讨论(0)
  • 2021-02-07 01:22

    Use the property flexGrow in the style, flex didnt worked for me.

     <ScrollView contentContainerStyle={{ flexGrow: 1 }}>
        ...
    </ScrollView>
    
    0 讨论(0)
提交回复
热议问题