iPhone 地图应用程序“Location Square”
在 iPhone 地图应用程序中,当您点击已放下的图钉上的显示箭头时,您会看到一种“位置方块”,如下所示:
我见过其他一些应用程序有此功能。我将如何实施这个?我没有在 MapKit 中找到任何具体的内容。
In the iPhone Maps application, you get a sort of 'location square' when you tap the disclosure arrow on a dropped pin, like this:
I've seen a few other apps have this. How would I implement this? I haven't found anything specific in MapKit for this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经实现了类似的功能,只需将图钉坐标传递到详细信息视图,使用您选择的 CGFrame 创建 MKMapView 并向其添加图钉。因为地图可能会被缓存(从之前的视图),所以您将立即加载它。
I've implemented something similar by simply passing the pin coordinates to the details view, creating an MKMapView with a CGFrame of your choice and adding a pin to it. Because the map is likely to be cached anyway (from the previous view) you will get it loaded straight away.
罗格对地图的想法是正确的,我将添加他遗漏的部分:圆角(您在评论中指出您也在寻找它)。
很多 UIView 的东西都免费提供圆角。这是我们放在 UITableViewCell 项上以获得类似效果的代码:
Rog has the right idea with the map, I'll just add part he left out inre: the rounded corners (you've indicated in the comments that you're looking for that as well).
Rounded corners comes for free with a lot of UIView stuff. This is code we put on UITableViewCell items to get a similar effect: