如何在ios中找到用户在屏幕上点击的位置 [英] how to find where the user tapped on the screen in ios

查看:625
本文介绍了如何在ios中找到用户在屏幕上点击的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找到用户在MapKit上点击的位置.我找不到建立连接的操作,因此我想知道是否有另一种方法可以建立连接.请让我知道.

I want to find where user tapped on MapKit. I cannot find a action to make a connection so i am wondering there is an alternate method for the same. please let me know.

推荐答案

正如@Disco S2所说,将MKMapView实例作为子视图添加到视图中.要知道您的用户在地图上的点击位置,请使用以下方法:

As @Disco S2 says, add the instance of MKMapView as a subview to your view. To know where your user tapped on the map, use this method:

- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(UIView *)view

这篇关于如何在ios中找到用户在屏幕上点击的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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