How does one Display a Hyperlink in React Native App?

前端 未结 11 1193
孤街浪徒
孤街浪徒 2020-12-12 16:38

How do I display a hyperlink in a React Native app?

e.g.

Google 
11条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 17:26

    To do this, I would strongly consider wrapping a Text component in a TouchableOpacity. When a TouchableOpacity is touched, it fades (becomes less opaque). This gives the user immediate feedback when touching the text and provides for an improved user experience.

    You can use the onPress property on the TouchableOpacity to make the link happen:

     Linking.openURL('http://google.com')}>
      
        Google
      
    
    

提交回复
热议问题