Google Maps GMSMapView on custom UIView

后端 未结 8 1675
陌清茗
陌清茗 2020-12-14 20:33

I want to display google maps on a view that\'s then added to self.view, rather than drawing the map directly on self.view. Therefore, I created a

8条回答
  •  情歌与酒
    2020-12-14 21:15

    We can use zPosition in iOS.

    If we have a view named salonDetailView, eg:

    @IBOutlet weak var salonDetailView: UIView!
    

    in my case see the image

    and have UIView for GMSMapView, eg:

    @IBOutlet weak var mapViewUI: GMSMapView!
    

    To show salonDetailView upper of the mapViewUI use zPosition as below:

    salonDetailView.layer.zPosition = 1
    

提交回复
热议问题