MKAnnotationView Only Rotate the Image property

為{幸葍}努か 提交于 2019-12-08 00:51:52

问题


I have an MKAnnotationView where I want to rotate the image property only.

If I use the following...

        self.image= image;
        [self setTransform:CGAffineTransformMakeRotation(DEG2RAD([item.heading floatValue]))];

It rotates the whole annotationView and the subsequent callouts which I do not want. Is there a way to just rotate the image property?


回答1:


The simplest way is probably to put the image in a UIImageView, add that as a subview to the MKAnnotationView, and affine that.

If you are targeting iOS 5.0 you could look at CIAffineTransform but I don't know enough about CoreImage to advise.



来源:https://stackoverflow.com/questions/8401514/mkannotationview-only-rotate-the-image-property

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