【发布时间】:2017-02-07 06:53:26
【问题描述】:
我正在尝试制作具有不同视图的滑出式导航应用。一种这样的观点是谷歌地图。但是,当我运行该应用程序时,会出现“Google”水印,但“我的位置”按钮缺少。它与这篇文章google map sdk ios 7 mylocationbutton disappear 非常相似,但self.edgesForExtendedLayout = UIRectEdge.None; 除了提供额外的空格之外没有任何改变。此外,为什么会出现谷歌水印而不是位置按钮是没有意义的。
在ViewController.swift
override func viewDidLoad() {
super.viewDidLoad()
locationManager.delegate = self
locationManager.requestWhenInUseAuthorization()
mapView.delegate = self
mapView.settings.rotateGestures = false;
mapView.settings.compassButton = true;
}
func locationManager(manager: CLLocationManager!, didChangeAuthorizationStatus status: CLAuthorizationStatus) {
if status == .AuthorizedWhenInUse {
locationManager.startUpdatingLocation()
mapView.myLocationEnabled = true
mapView.settings.myLocationButton = true
}
}
非常感谢任何帮助!
【问题讨论】:
标签: ios google-maps swift