skip to Main Content

i’m trying to create an app and i’m using touchable opacity instead of button.
i just wanna disable voice that on press touchable opacity component.

<TouchableOpacity activeOpacity={1} touchSoundDisabled={true} onPress={this._onPress}>
    ...
</TouchableOpacity>

i tried to touchSoundDisabled={true} but not working

2

Answers


  1. I’m not sure which version of react native are you using, but I’m guessing what you are looking for is android_disableSound prop rather than touchSoundDisabled

    Login or Signup to reply.
  2. You can use Pressable in place of TouchableOpacity,

    Just add <Pressable android_disableSound={true} ></Pressable>

    one drawback is you cant get onTouch animations, but pressable is powerful

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search