Rotate the content of a MKMapView

扶醉桌前 提交于 2019-12-04 01:48:55

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/1551282/rotate-the-content-of-a-mkmapview

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