React Native Nested ScrollView 无法在 Android 设备上滚动 [英] React Native Nested ScrollView Can`t Scroll on Android Device

查看:44
本文介绍了React Native Nested ScrollView 无法在 Android 设备上滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Android 设备上遇到了嵌套滚动视图的问题,但 IOS 正常

I have the problem about nested scrollview on Android Device, but IOS OK

如何解决B scrollview无法滚动的问题?

How to fix the issue about B scrollview cant scrolling ?

<ScrollView>  // A ScrollView
    <View><Text>Hello</Text></View> 
    <View><Text>Hello</Text></View> 
    <View><Text>Hello</Text></View> 
    <View><Text>Hello</Text></View> 
    <View>       
        <ScrollView> // B ScrollView
            <View><Text>Hello</Text></View>         
            <View><Text>Hello</Text></View>         
            <View><Text>Hello</Text></View>          
            <View><Text>Hello</Text></View>      
        </ScrollView> 
    </View>
</ScrollView>

推荐答案

如果 API 21 作为最低目标是一个选项,您可以升级到 react-native 0.56.x 并尝试 新道具 nestedScrollEnabled.

If API 21 as minimum target is an option, you could upgrade to react-native 0.56.x and try the new prop nestedScrollEnabled.

注意:它是为了在子滚动视图中使用,即

Note: it is meant to be used in the child scrollview, i.e.

<ScrollView {...parentProps}>
  <ScrollView {...childProps} nestedScrollEnabled={true}>
  </ScrollView>
</ScrollView>

这篇关于React Native Nested ScrollView 无法在 Android 设备上滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆