MKMapView ignores its layoutMargins since iOS 11.0

Originator:lap.felix
Number:rdar://39287771 Date Originated:09-Apr-2018 02:42 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11.3
Classification:UI/Usability Reproducible:Always
 
Summary:
Setting margins to n MKMapView with the layoutMargins property does not work

Steps to Reproduce:
Add, in an empty view controller's viewDidLoad:

    MKMapView *mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0, 100, self.view.bounds.size.width, 400)];
    mapView.camera.heading = 45;
    [self.view addSubview:mapView];

    // the map margins are completely ignored
    mapView.layoutMargins = UIEdgeInsetsMake(30, 30, 30, 30);

Expected Results:
The map's layout margins should be set to 30 on all sides and the compass and legal attribution label should be inset by 30 points.

Actual Results:
On iOS 11 the compass and legal attributions stay in the corners as if the layoutMargins property was set to UIEdgeInsetsZero

Version:
iOS 11.3

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!