TouchableOpacity wont work as supposed in android

Viewed 76

I got an app with flatlist ,I added to the app TouchableOpacity that covers the whole screen, works great when I click on item area but doesn't work when I click the area that got no items this is the code of the TouchableOpacity:

<View style={{position: "absolute",width:'100%',height:HEIGHT,backgroundColor: 'rgba(0,0,0,0.8)',zIndex:6}}>
  <TouchableOpacity onPress={()=>setEditing(false)} style={{flex:1,zIndex:6}}>
  </TouchableOpacity>

Its looks like the flatlist block any clicks below it also in ios its works without any problems

1 Answers

Try change it to:

<View style={{position: "absolute",width:'100%',height:HEIGHT,backgroundColor: 'rgba(0,0,0,0.8)',zIndex:6}}>
  <TouchableOpacity onPress={()=>setEditing(false)} style={{flex:1,zIndex:7}}>
  </TouchableOpacity>
</View>

and run it

Related