简体   繁体   English

将MKMapView发送回iOS

[英]send MKMapView to back in iOS

I have MKMapView on which and I want to display UIView dynamically over the MapView but view never comes to the front. 我有MKMapView ,我想在MapView动态显示UIView ,但是视图永远不会出现在最前面。 So, what is the solution to this problem? 那么,该问题的解决方案是什么?

Try to call the below method. 尝试调用以下方法。 Where you are want show UIView. 您想在哪里显示UIView。

yourViewObject.layer.zPosition = 1

Try to call the below method when you wants to bring the view to the front. 若要将视图置于最前面,请尝试调用以下方法。

[self.view bringSubviewToFront:yourView];

Else 其他

Create a view above the MkMapView and Dynamically Show/hide the view using the following: 在MkMapView上方创建一个视图,并使用以下方法动态显示/隐藏该视图:

[yourView setHidden:NO];

Simply use: 只需使用:

[self.view bringSubviewToFront:yourView];

or 要么

If you are adding your view in mapView, 如果您要在mapView中添加视图,

 [mapView bringSubviewToFront:yourView];

If it does not work then please post some of your code. 如果它不起作用,请发布一些代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM