Maps and legal mention

强颜欢笑 提交于 2019-12-20 03:38:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!