Hi Guys I have an issue where some text is being overlapped by another object.
Here is an image of what's happening.
You can see that the second line of text is behind the white shape, how can I make it so it becomes above the white shape? Ive tried z order and various other positions but can't get my head round this.
The code for this:
code for the white square:
const Square = () => {
return <View style={styles.square} />;
};
then the main code
<View style={{flex: 1, padding: 0}}>
{isLoading ? (
<Text>Loading...</Text>
) : (
<SafeAreaView style={{flex: 1, backgroundColor: '#8af542'}}>
<View
style={{
marginTop: 150,
alignItems: 'center',
justifyContent: 'center',
}}>
<Text>TEST</Text>
<Text
style={{
position: 'absolute',
top: 140,
zIndex: 1,
elevation: 1,
}}>
TEXT HERE
</Text>
</View>
<View
style={{
flex: 1,
justifyContent: 'flex-end',
marginBottom: windowHeight * -0.05,
}}>
<Square></Square>
</View>
</SafeAreaView>
)}
</View>
Then here are the styles:
const styles = StyleSheet.create({
centerItems: {
justifyContent: 'center',
alignItems: 'center',
},
square: {
width: windowWidth,
height: windowHeight * 0.6,
backgroundColor: 'white',
flex: 1,
justifyContent: 'flex-end',
marginBottom: windowHeight * -0.05,
position: 'absolute',
},
});