简体   繁体   English

react-native是否支持NSDataDetector?

[英]Does react-native support NSDataDetector?

Is there a way to access Cocoa's NSDataDetector from react-native ? 有没有办法从react-native访问Cocoa的NSDataDetector

Something like UITextView 's dataDetectorTypes ? 类似于UITextViewdataDetectorTypes吗?

I want to use it for automatic Address detection, to link to Maps. 我想将其用于自动地址检测,以链接到地图。

I don't think that NSDataDetector themselves support RN atm. 我不认为NSDataDetector本身支持RN atm。 But there are couple of libraries that you might be interested in. 但是您可能对几个库感兴趣。

I am not sure my answer will solve your scenario. 我不确定我的答案会解决您的情况。 But I had a requirement of needing to enable text links clickable and phone numbers as well. 但是我有一个需要启用文本链接可点击和电话号码的要求。

react native html view - https://github.com/jsdf/react-native-htmlview . 反应本地html视图-https : //github.com/jsdf/react-native-htmlview

This helped me to solve my situation. 这帮助我解决了我的处境。 Also have a look at AutoLinker 也看看AutoLinker

React Native的TextInput组件具有一个dataDetectorProps,可以完全满足您的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM