Lee Armstrong
Lee Armstrong

Reputation: 11452

MKAnnotationView Only Rotate the Image property

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?

Upvotes: 2

Views: 961

Answers (1)

Rogers
Rogers

Reputation: 1973

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.

Upvotes: 1

Related Questions