加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react-native – ReactNative onResponderRelease在Android上不

发布时间:2020-12-15 20:44:38 所属栏目:百科 来源:网络整理
导读:我试图在 Android设备上使用ScrollView的onResponderRelease事件,但它不能正常工作.像这样的代码: ScrollView onResponderRelease = {()={console.log('release')}}/ 我看到很多反应原生的lib都像这样使用这个api. 它支持android平台吗? 是的,它有这样的问
我试图在 Android设备上使用ScrollView的onResponderRelease事件,但它不能正常工作.像这样的代码:
<ScrollView 
    onResponderRelease = {()=>{console.log('release')}}
/>

我看到很多反应原生的lib都像这样使用这个api.
它支持android平台吗?

是的,它有这样的问题 – 您可以阅读有关此 https://github.com/facebook/react-native/issues/9447的更多信息

尝试使用’onMomentumScrollEnd’,在某些情况下,它会完全符合您的期望:

<ScrollView 
    onMomentumScrollEnd = {()=>{console.log('release on Android')}}
    onResponderRelease = {()=>{console.log('release on IOS')}}
/>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读