Touchable* would not be touchable in the sample code.
Any position relative view covers the screen, the absolute view would not render above it no matter how many zIndex was set.
<View style={{flex: 1}}>
<View style={{position: 'absolute', top: 80, zIndex: 50, backgroundColor: 'green',height: 60, width: 60, zIndex: 3}}>
<TouchableOpacity><Text>Hello World4</Text></TouchableOpacity>
</View>
<ScrollView style={{flex: 1}}>
</ScrollView>
</View>
Put the absolute view after the scrollview.
Does anybody know why putting the absolute View after the Scrollview actually works? It seems so arbitrary. 馃槩
@vnglst Arbitrary maybe, but this is the way it鈥檚 been on the web for ages, so it鈥檚 nothing new. An element that comes after another in the DOM has higher implicit z-index.
Most helpful comment
Put the absolute view after the scrollview.