如何在mapview中移动合法签到

Fab*_*erg 13 objective-c mkmapview

我想知道是否有人知道你如何在mapview上移动合法标志,现在我的工具栏正在覆盖它.有谁知道怎么样?谷歌徽标有很多帮助,但苹果地图上没有任何帮助.

左下角的法律标志

And*_*mon 11

在Swift中:

mapView.layoutMargins = UIEdgeInsetsMake(top, right, -20, left)
Run Code Online (Sandbox Code Playgroud)

我在OS9中对此进行了测试,但它确实有效.


Sas*_*cha 10

这应该有用,虽然我不确定Apple是否会允许你这样做

UILabel *attributionLabel = [mapView.subviews objectAtIndex:1];
attributionLabel.center = CGPointMake(attributionLabel.center.x, attributionLabel.center.y - 44.0f);
Run Code Online (Sandbox Code Playgroud)

  • @Klaas是的,他们做到了! (2认同)

Chu*_*584 8

这仍然可以在iOS 7中使用,但只有(?)如果放入viewDidAppear.如果放入viewDidLoad或中,则会重置坐标viewWillAppear.

    UILabel *attributionLabel = [mapView.subviews objectAtIndex:1];
    attributionLabel.center = CGPointMake(attributionLabel.center.x, attributionLabel.center.y - 44.0f);
Run Code Online (Sandbox Code Playgroud)


Den*_*ess 7

这些方法不再适用于iOS 7.正确的方法是在UIViewController上指定bottomLayoutGuide.这里详细描述