ios - 快速在地图上的uitextview中使电话号码可点击
问题描述
我想使用 datadetector 在 MapView 上的 UITextView 中制作电话号码,但它不起作用。
有问题的 textView 是通用 UIView 的子视图,它是 Map 上 MKAnnotationView 的子视图,因此子视图层次结构中的某些东西可能导致问题。
下面是配置 textView 的代码:
textView.font = UIFont.systemFont(ofSize: 14)
textView.isUserInteractionEnabled = true
textView.isSelectable = true
textView.isEditable = false
textView.dataDetectorTypes = UIDataDetectorTypes.all
//mycustomview is a plain rectangular uiview
myCustomView.addSubview(textView)
//annotationview is an MKAnnotationView
annotationView.addSubview(myCustomView)
在此先感谢您的任何建议
解决方案
推荐阅读
- python - Django REST:项目与应用
- wordpress - Sabre WordPress 集成
- vue.js - Vuejs- if..else 语句中未达到第二个 axios.get
- javascript - 如何在 p5.js 中获得顶视图房子
- excel - 用条目将特定范围与最后一行相邻是什么错误?
- linux - 使用 github 操作在 Linux 下构建基于 Qt5 的 Windows 程序的最简单/最快的方法?
- c# - 每当使用具有唯一文件名的 serilog 执行控制台 appln 时,我都想创建新的日志文件
- android - RenderBox 未布置:RenderConstrainedBox#358ca relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
- node.js - NodeJS请求得到返回我的html代码而不是json
- c++ - 我的程序在第一次迭代后不会接受输入