Google Maps iOS SDK move “My Location” button to bottom left hand corner

前端 未结 6 2120
南方客
南方客 2020-12-13 22:27

Using the Google Maps for iOS SDK, the \"My Location\" button is by default placed in the bottom right hand corner:

6条回答
  •  佛祖请我去吃肉
    2020-12-13 23:13

    As of July 2015, this is a way to do it:

    for (UIView *object in mapView_.subviews) {
        if([[[object class] description] isEqualToString:@"GMSUISettingsView"] )
        {
            for(UIView *view in object.subviews) {
                if([[[view class] description] isEqualToString:@"GMSx_QTMButton"] ) {
                    CGRect frame = view.frame;
                    frame.origin.y -= 60;
                    view.frame = frame;
                }
            }
    
        }
    };
    

提交回复
热议问题