react-native-paper - 如何向 React Native Paper Paragraph 添加超链接或邮件链接?
问题描述
如何添加到 react-native-paper<Paragraph></Paragraph>
标签的链接?
解决方案
对于 Android,dataDetectorType 也适用于 RN Paper段落。
<Paragraph dataDetectorType="link">http://youraddress</Paragraph>
或者<Paragraph dataDetectorType="email">mail address</Paragraph>
但是对于 iOS 和 Android 来说,实现这一点的最简单方法是使用Linking。
import { Linking, } from } from 'react-native';
然后
<Paragraph
style={{ color: 'blue', textDecorationLine: 'underline', }}
onPress={() => Linking.openURL('mailto:address')}>
mail
</Paragraph>
推荐阅读
- javascript - 使用 jquery 或纯 javascript 从今天日期到每年特定日期的倒计时天数
- ruby-on-rails - 如何处理 Rails ENCRYPTED 凭证文件中的合并冲突
- cucumber - Cucumber - 如何配置 QAF Gherkin Scenario Factory?
- sql-server - 根据当前日期递增表名
- google-apps-script - 如果发生脚本错误,请在电子表格中添加答案
- dji-sdk - 如何在虚拟摇杆上实现 rc 命令?
- sql - SQL Server:选择具有 3 个匹配字符的列
- encryption - RSA 如何加密/解密?
- python - Selenium:VSCode 找不到导入
- java - Clob 到 String 的转换很慢