Is there any way by which transform of a view for rotation wont be passed to its subviews? I have a custom MKAnnotationView which I am rotating according to the heading values of the user. In below method in the custom Annotation view class , i am adding a subview to the annotation view.
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
if(selected)
{
[self addSubview:self.myCallOutView];
return;
}
[self.myCallOutView removeFromSuperview];
}
but the problem is when my annotation view is rotated and then I select any annotation, myCallOutView also appears rotated which I dont want. I am rotating custom Annotation view using below line
[self setTransform:CGAffineTransformMakeRotation(angle * M_PI / -180.0)];
How can i avoid this situation? Do i need to apply some transform on myCallOutView before adding it as a subview?