Scroll View inside view not working react native

后端 未结 8 1981
渐次进展
渐次进展 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:28

    you should wrap toolbar in view like this:

    <View><Toolbar/></View>
    

    Wrap those component which you want to scroll inside scrollview as:

    <ScrollView>your expected components...</ScrollView>
    

    And provide flex to root view as:

    <View style={{flex:1}}>
    

    Finally your code will run as you expected.

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

    Use react fragments instead of a View to wrap your scroll view it worked for me

    <>
    <ScrollView>
     .......... 
    </ScrollView>
    </>
    
    0 讨论(0)
提交回复
热议问题