如何在React Native App中显示超链接? [英] How does one Display a Hyperlink in React Native App?

查看:54
本文介绍了如何在React Native App中显示超链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在React Native应用程序中显示超链接?

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

例如

<a href="https://google.com>Google</a> 

推荐答案

类似以下内容:

<Text style={{color: 'blue'}}
      onPress={() => Linking.openURL('http://google.com')}>
  Google
</Text>

使用与React Native捆绑在一起的 Linking 模块.

using the Linking module that's bundled with React Native.

import { Linking } from 'react-native';

这篇关于如何在React Native App中显示超链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆