Rotate the content of a MKMapView

2019-02-19 08:13发布

I need to rotate the content of the mapView according to the compass value:

float myHeadingValue = newHeading.trueHeading;

and for rotating the map I use this:

[mapView setTransform:CGAffineTransformMakeRotation( [self degreesToRadians:myHeadingValue] )];

but it rotates the view, not the content of the view.

How can I make it to rotate the content, not the whole view?

2条回答
祖国的老花朵
2楼-- · 2019-02-19 08:25

I've solved it creating in Interface Builder a smaller UIView and putting the MKMapView into it. The new UIView does not show the leftover map.

查看更多
淡お忘
3楼-- · 2019-02-19 08:31

There may be an issue with the google logo being out of shot doing this though. Apple have contacted me to say that my app contravened the guidelines because the google logo was invisible.

查看更多
登录 后发表回答