如何使用Swift在Google地图中更改我的位置按钮的位置 [英] How to change location of my location button in google maps using swift

查看:145
本文介绍了如何使用Swift在Google地图中更改我的位置按钮的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用Google地图,我想显示我的位置按钮 我应该怎么用swift

I am using google maps in my project i want to show my location button a bit up how should i do that using swift

推荐答案

您可以更改地图控件,为地图视图设置填充.

You can change the position of the MapControls by set the padding for your map view .

 let mapView = GMSMapView()

 mapView.isMyLocationEnabled = true
 mapView.settings.myLocationButton = true

 mapView.padding = UIEdgeInsets(top: 0, left: 0, bottom: 50, right: 50)

它将更改我的位置控件的填充.从底部50像素到右侧50像素

请参考下面的屏幕快照,该屏幕底部和右侧添加了50px的填充.

Refer the below screenshot which added the padding of 50px from bottom and right.

这篇关于如何使用Swift在Google地图中更改我的位置按钮的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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