UITextview dataDetectorTypeAddress-在其他应用程序中打开的地图 [英] UITextview dataDetectorTypeAddress - Map opened in different application

查看:56
本文介绍了UITextview dataDetectorTypeAddress-在其他应用程序中打开的地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我才刚刚了解UITextViews的出色ios功能,即

I just came to know about an awesome ios feature for UITextViews i.e UITextview dataDetectorTypes. It is really useful to display text as links.

但是,我注意到一件事.当字符串是物理地址时,将打开适当的Google Map,但在其他应用程序中.

However, I noticed one thing. When the string is a physical address, Google Map is opened which is appropriate, but in a different application.

有什么方法可以在应用程序中打开该Google地图,而不进入打开了地图的默认iOS应用程序中吗?这样我就可以从地图上回到我的应用程序中.是否有任何可以控制此值的委托方法?现在,我必须最小化应用程序(使其在后台运行),然后再次打开它,效果并不理想.

Is there any way we can open that google map in our application and not go into default iOS application wherein map is opened? So that I can go back into my application from the map. Is there any delegate method which can control this? Right now I have to minimize the application(make it run in background) and again open it which does not looks good.

推荐答案

您应该使用其他解决方案.

You should use another solution for your problem.

如果您使用dataDetectorTypes,则始终会先在内置应用程序中打开链接.

If you use dataDetectorTypes, the link is alway opened in built-in app firstly.

您可以使用按钮和自定义字符串进行操作,如下所示:

You can make your action with button and custom string as below:

  • 将您的文本推入UIButton.

  • push your text into an UIButton.

使用NSAtributedSring作为此问题的链接来显示您的文本,请使用UIButton代替UITextView:

make your text displayed as link with NSAtributedSring as this question, use UIButton instead of UITextView:

在uitextview内部加下划线

  • 用户单击按钮时对按钮进行操作.

祝你好运!

这篇关于UITextview dataDetectorTypeAddress-在其他应用程序中打开的地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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