问题
With iOS < 6.0 we were able to re-position the "Google" link over map view (by browsing the subviews of map view). Now with iO6, there's a "legal" link and this is a MKAttributeLabel. A private class that we can't manipulate ...
My problem is that I must add a footer subview to my map and it'll hide the legal link ... How can I solve this problem without any App Store rejection ?
Can I create another legal button my self and add it where I want in my map view ? I have no idea what I'm able to do...
回答1:
Does the footer view have to be inside the map boundary, why not put the map and the footer into the same super view?
回答2:
There's a few answers recommending you move the legal label in the viewDidAppear
of your view controller, however this doesn't work if you then resize your map view (like I am).
The best way is to subclass the MKMapView
and override the layoutSubviews
method. In my example I just needed to nudge the legal label above a semi-transparent toolbar.
-(void)layoutSubviews { [super layoutSubviews]; UILabel *legalLabel; for(UIView *view in self.subviews) { if([view isKindOfClass:[UILabel class]]) { legalLabel = (UILabel *)view; break; } } legalLabel.center = CGPointMake(legalLabel.center.x, self.bounds.size.height - 55.0f); }
来源:https://stackoverflow.com/questions/12891373/maps-and-legal-mention