Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you move the legal sign in mapview

I wonder if anyone know how you move the legal sign on a mapview, right now my toolbar is covering it. Does anyone know how? There is lot's of help with the google logo but nothing on the apple maps.

Legal sign in bottom left corner

like image 588
Fabian Lundberg Avatar asked Nov 02 '12 19:11

Fabian Lundberg


4 Answers

Swift 4+

You can change the position of those by setting the layoutMargins of the mapView.

For example this will push it off from the bottom:

mapView.layoutMargins.bottom = -100

Also you can change edge insets you need all at once:

mapView.layoutMargins = UIEdgeInsets(top: 0, left: 0, bottom: -100, right: 0)
like image 81
Mojtaba Hosseini Avatar answered Sep 27 '22 02:09

Mojtaba Hosseini


In Swift:

mapView.layoutMargins = UIEdgeInsetsMake(top, right, -20, left)

I tested this in OS9 and it works.

Swift 5.2

// -20 will make the legal disclaimer move down. If you want the
// disclaimer to move up, use a positive number.
mapView.layoutMargins = UIEdgeInsets(top: 0, left: 0, bottom: -20, right: 0)
like image 25
Andre Simon Avatar answered Nov 05 '22 11:11

Andre Simon


This should work, although I'm not sure whether Apple will allow you to do that

UILabel *attributionLabel = [mapView.subviews objectAtIndex:1];
attributionLabel.center = CGPointMake(attributionLabel.center.x, attributionLabel.center.y - 44.0f);
like image 10
Sascha Avatar answered Nov 05 '22 11:11

Sascha


This is still possible in iOS 7, but only (?) if placed in viewDidAppear. The coords are reset if placed in viewDidLoad or viewWillAppear.

    UILabel *attributionLabel = [mapView.subviews objectAtIndex:1];
    attributionLabel.center = CGPointMake(attributionLabel.center.x, attributionLabel.center.y - 44.0f);
like image 8
Chuckels5584 Avatar answered Nov 05 '22 11:11

Chuckels5584