Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.8k
Open
Labels
Description
Description
Hi,
I would like to have a lottie view which covers the entire screen and allow touches underneath. To allow touches underneath, I would passpointer-events
:none
which works nicely on iOS, but not on Android.
Screen.Recording.2024-10-25.at.9.14.26.AM.mov
Sample code, also available inlinked repo:
importLottieViewfrom'lottie-react-native';import{Alert,Button,SafeAreaView,StyleSheet,View}from'react-native';functionApp(){return(<SafeAreaViewstyle={styles.screen}><Buttontitle="Press Me"onPress={()=>Alert.alert('Hey!')}/><LottieViewstyle={styles.lottie}source={require('./assets/Animation - 1729763779569.json')}autoPlayloop/></SafeAreaView>);}conststyles=StyleSheet.create({screen:{flex:1,backgroundColor:'#fff',},lottie:{ ...StyleSheet.absoluteFillObject,pointerEvents:'none',},});exportdefaultApp;
Note that the workaround is easy and that is to wrap the lottie view in another view and set the pointer events there to none which is what I do for now, but I would like the lottie view to work on its own too
Steps to reproduce
- Clone repo
- Run on Android
- Try clicking on the button behind the lottie view
Snack or a link to a repository
https://github.com/itsramiel/AndroidLottie
Lottie React Native version
7.0.0
React Native version
0.75.4
Platforms
Android
Workflow
React Native
Architecture
Paper (Old Architecture)
Build type
Debug app & dev bundle
Device
Android emulator
Acknowledgements
Yes