iPhone SDK - opening links in a UITextView in a web view(iPhone SDK - 在 Web 视图中的 UITextView 中打开链接)
问题描述
我在 UITextView 上指定了 dataDetectorTypes,以便在触摸时在 Safari 中打开 URL.
I have specified dataDetectorTypes on a UITextView so that URLs open in Safari when touched.
是否可以拦截此行为,以便我将 URL 加载到 UIWebView 中?或者我会编写自己的 URL 检测器代码来重新路由它吗?
Is it possible to intercept this behaviour so I load the URL in a UIWebView instead? Or would I have write my own URL detector code to re-route this?
推荐答案
您必须自己进行 URL 检测,并在点击 URL 时手动加载 UIWebView.
You would have to do the URL detection yourself and manually load the UIWebView when the URL is tapped.
一切都需要定制,因为 Apple 会将所有 http://
和 https://
URL 开口发送到 Safari.
Everything needs to be custom-done because Apple sends all http://
and https://
URL openings to Safari.
这篇关于iPhone SDK - 在 Web 视图中的 UITextView 中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iPhone SDK - 在 Web 视图中的 UITextView 中打开链接


基础教程推荐
- 在 iOS 上默认是 char 签名还是 unsigned? 2022-01-01
- :hover 状态不会在 iOS 上结束 2022-01-01
- Android文本颜色不会改变颜色 2022-01-01
- LocationClient 与 LocationManager 2022-01-01
- Android ViewPager:在 ViewPager 中更新屏幕外但缓存的片段 2022-01-01
- 固定小数的Android Money Input 2022-01-01
- 如何使用 YouTube API V3? 2022-01-01
- 如何使 UINavigationBar 背景透明? 2022-01-01
- 使用 Ryzen 处理器同时运行 WSL2 和 Android Studio 2022-01-01
- “让"到底是怎么回事?关键字在 Swift 中的作用? 2022-01-01