MKAnnotationView仅旋转“图像"属性 [英] MKAnnotationView Only Rotate the Image property
本文介绍了MKAnnotationView仅旋转“图像"属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个MKAnnotationView,我只想旋转image属性.
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?
推荐答案
最简单的方法可能是将图像放在UIImageView中,并将其作为子视图添加到MKAnnotationView中,然后进行仿射.
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.
这篇关于MKAnnotationView仅旋转“图像"属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文