如何使React Native Animated.View可点击? [英] How to make React Native Animated.View clickable?

查看:532
本文介绍了如何使React Native Animated.View可点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此React Native Tinder演示-> https:// github .com / brentvatne / react-native-animated-demo-tinder

I'm using this react native tinder demo -> https://github.com/brentvatne/react-native-animated-demo-tinder

是否可以使卡片可点击,以便导航到另一个视图点击?我尝试将 Touchable组件包装在动画视图周围,但是这样做会禁用动画。

Is it possible to make the cards 'clickable' so it would navigate to another view on click? I've tried wrapping the "Touchable" components around the animated view but doing so disables the animations.

任何想法都会受到高度赞赏,谢谢!

Any ideas would be highly appreciated, thanks!

推荐答案

我猜您可以在Animated.View中使用TouchableX

I guess you can use TouchableX inside the Animated.View

<Animated.View>
  <TouchableOpacity>
    <View>
      stuff
    <View>
  </TouchableOpacity>
</Animated.View>`

这篇关于如何使React Native Animated.View可点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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