目前,当我使用 GMSMapView api 将按钮设置为显示时,它会显示在右下角。
SO 上还有一个关于此的问题,但这是针对 swift 而不是针对 Objective-C 的(并且它针对屏幕上的不同位置。)
最佳答案
只需调整此解决方案 post
从我的头顶看,它看起来像这样:
let myLocationButton = mapView.subviews.last! as! UIButton
myLocationButton.autoresizingMask = UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin
let frame = myLocationButton.frame
frame.origin.y = 10
myLocationButton.frame = frame
关于iOS 快速将我的位置按钮移动到右上角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39609116/