Svg with TouchableOpacity
See original GitHub issueHi,
I would like to create my image buttons with SVG using TouchableOpacity element. But my problem is I don’t have the opacity event triggered on press button.
This is my render :
render() { return ( <TouchableOpacity onPress={this.props.onPress}> <Svg width={100} height={100} viewBox="0 0 104 104" > .... </Svg> </TouchableOpacity> ); }
I would like to know how to create a button with SVG image (if it is possible).
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top Results From Across the Web
Svg with TouchableOpacity · Issue #645 - GitHub
Hi,. I would like to create my image buttons with SVG using TouchableOpacity element. But my problem is I don't have the opacity...
Read more >Touchable opacity on press not working inside SVG tags
The reason for that is that SVG is at the top as parent element, disabling the accessibility to TouchableOpacity . This means the...
Read more >ReactNative: using SVG as a button - Krasimir Tsonev
Just recently I started using ReactNative. I've been using React for years but this thing is a whole new world.
Read more >Test svg touchable - Expo Snack
Try this project on your phone! Use Expo's online editor to make changes and save your own copy.
Read more >Touchable opacity on press not working inside SVG tags ...
The reason for that is that SVG is at the top as parent element, disabling the accessibility to TouchableOpacity . This means the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Simplified into plain component:
The solution above doesn’t work on all Android devices. e.g. Works on Essential PH-1 and it doesn’t on LG G5 or Samsung S21 - the ripple effect of touching works, onPress is not called though.