文本和 TouchableOpacity 文本未出现在直线中
Text and TouchableOpacity text not appearing in straight line
我试图在纯文本旁边附上一些可触摸不透明度,但是,两个可触摸之间的纯文本与可触摸文本不一致。请指导如何解决这个问题。
<Text style={{fontSize:10,textAlign:'center',}}>By clicking Sign up, you agree to Company's <TouchableOpacity ><Text style={{fontSize:10, color:'blue'}}>Terms of Service</Text></TouchableOpacity> and <TouchableOpacity><Text style={{fontSize:10, color:'blue'}}>Privacy Policy.</Text></TouchableOpacity></Text>
不需要 touchableopacity
因为 Text
有 onPress
prop.
<Text style={{fontSize:10,textAlign:'center'}}>
By clicking Sign up, you agree to Companys
<Text
onPress={() => alert("Terms of Service is clicked")}
style={{fontSize:10, color:'blue'}}>
Terms of Service
</Text>
and
<Text
onPress={() => alert("Privacy Policy is clicked")}
style={{fontSize:10, color:'blue'}}>
Privacy Policy.
</Text>
</Text>
我试图在纯文本旁边附上一些可触摸不透明度,但是,两个可触摸之间的纯文本与可触摸文本不一致。请指导如何解决这个问题。
<Text style={{fontSize:10,textAlign:'center',}}>By clicking Sign up, you agree to Company's <TouchableOpacity ><Text style={{fontSize:10, color:'blue'}}>Terms of Service</Text></TouchableOpacity> and <TouchableOpacity><Text style={{fontSize:10, color:'blue'}}>Privacy Policy.</Text></TouchableOpacity></Text>
不需要 touchableopacity
因为 Text
有 onPress
prop.
<Text style={{fontSize:10,textAlign:'center'}}>
By clicking Sign up, you agree to Companys
<Text
onPress={() => alert("Terms of Service is clicked")}
style={{fontSize:10, color:'blue'}}>
Terms of Service
</Text>
and
<Text
onPress={() => alert("Privacy Policy is clicked")}
style={{fontSize:10, color:'blue'}}>
Privacy Policy.
</Text>
</Text>