如何使用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.