1

I'm using the answer os this post to change Map Legal Text position on the screen (Put it on the up right corner of the screen). Its works fine, but when the map is rotated, it fails.

I tried to insert the code in the following method to get the end of the rotation:

- (void)mapView:(MKMapView *)mapView didChangeUserTrackingMode:(MKUserTrackingMode)mode animated:(BOOL)animated

But the legal text returns to its original position (bottom left corner).

How do I move the legal text again after the rotation ending?

Community
  • 1
  • 1

1 Answers1

0

In viewDidAppear add following to change the legal label position

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

or another solution use topLayoutGuide and bottomLayoutGuide

.h

@interface MapLayoutGuide : NSObject <UILayoutSupport> @property (nonatomic) CGFloat aaLength; - (id)initWithLength:(CGFloat)length; @end

.m

@implementation MapLayoutGuide - (id)initWithLength:(CGFloat)length { self = [super init]; if (self) { _aaLength = length; } return self; } - (CGFloat)length { return _aaLength; } @end

Usage:

- (id<UILayoutSupport>)topLayoutGuide { return [[MapLayoutGuide alloc]initWithLength:44]; } - (id<UILayoutSupport>)bottomLayoutGuide { return [[MapLayoutGuide alloc]initWithLength:44]; }

JoeyJAL
  • 194
  • 1
  • 9
  • Didn't work. Still the same problem of the post a mentioned in my question. The legal text keep returning to the original position (bottom left corner of the screen). Tks anyway. – user2264177 Jul 08 '14 at 18:41