I want to show text on image using absolute position. However, it is difficult to determine the exact position because the screen size is different for each device.
Is there a way to calculate the exact position?
I posted a similar question, but I didn't get the answer I wanted. my first question
Below is the code I've tried.
<ImageBackground
source={require("../../assets/brain/ohi.png")}
style={{ width: "100%", height: "100%", position: "relative" }}
resizeMode="contain"
onLayout={(event) => this.setLayout(event.nativeEvent.layout)}
>
<Text
style={{
position: "absolute",
left: windowWidth * 0.22,
top: windowHeight * 0.4,
}}
>
Text_1
</Text>
<Text
style={{
position: "absolute",
left: 280,
top: 300,
}}
>
Text_2
</Text>
</ImageBackground>