'TouchableOpacity wont work as supposed in android

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



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lenny Rey