I'm new to ReactNative. In the application, I want to add a link to a text within the text. As seen in the photo, the purple text the link is linked to is slightly above the normal text. No matter what I tried, I could not align this text with the text below. I want to do responsive design, so the code I'm going to write should look the same on every device. Can you help me with this?
Codes:
import React from 'react'
import {
StyleSheet,
Text,
TouchableOpacity,
View
} from 'react-native'
import {
Dimensions
} from "react-native"
const units = {
width: Dimensions.get("window").width,
height: Dimensions.get("window").height,
}
const VideoPlayback = () => {
return ( <
View style = {
styles.container
} >
<
View style = {
styles.advertContainer
} >
<
View style = {
styles.adverPicture
} > < /View>
<
View style = {
styles.textContainer
} >
<
Text >
Everyone is watching this so they can learn math.
<
TouchableOpacity onPress = {
() => console.log('open advert')
} > { < Text style = {
styles.advertLinkText
} > It is your turn < /Text>} < /
TouchableOpacity >
<
/Text> < /
View >
<
/View> < /
View >
)
}
export default VideoPlayback
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#FFFFFF",
},
advertContainer: {
width: units.width,
height: units.height / 8.78,
backgroundColor: "#F5F5F5",
marginTop: units.height / 20,
borderTopWidth: 1,
borderBottomWidth: 1,
borderColor: '#E9E9E9',
alignItems: 'center',
flexDirection: 'row'
},
adverPicture: {
width: units.width / 3.02,
height: units.height / 11.25,
backgroundColor: 'black',
marginLeft: units.width / 45
},
textContainer: {
width: units.width / 1.69,
marginLeft: units.width / 30,
},
advertLinkText: {
color: "#957DAD",
}
})