How do I enable touch on multiple buttons simultaneously in react native?

后端 未结 4 2038
旧巷少年郎
旧巷少年郎 2020-12-16 02:02

I need that when I am touching and holding one button then I should also be able to touch on the button 1.

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-16 02:36

    Try:

    import { TouchableOpacity } from 'react-native';
    

    Instead of:

    import { TouchableOpacity } from 'react-native-gesture-handler';
    

    Will help you to multiple buttons.

    For example, if you have a TouchableOpacity inside a TouchableWithoutFeedback, when TouchableOpacity is touched, it will only call TouchableOpacity's onPress, and will not be called onPress of TouchableWithoutFeedback.

提交回复
热议问题