I have one UIView that I rotate manually when orientation changes, this UIView hosts a number of buttons, I want to rotate them too based on the change in orientation.
I am doing this :
CGAffineTransform rotation = CGAffineTransformMakeRotation(M_PI / -4);
[UIView animateWithDuration:0.25 animations:^
{
self.parentView.firstButton.transform = CGAffineTransformConcat(self.parentView.firstButton.transform, rotation);
self.parentView.secondButton.transform = CGAffineTransformConcat(self.parentView.secondButton.transform, rotation);
self.parentView.thirdButton.transform = CGAffineTransformConcat(self.parentView.thirdButton.transform, rotation);
self.parentView.transform = CGAffineTransformConcat(self.parentView.transform, rotation);
}
completion:^(BOOL finished)
{
}];
parentView does rotate properly, but the other buttons do not !!
do I need to perform the rotation in another call? as in I cannot rotate a button and its parentview in the same block?
Thanks
Copyright Notice:Content Author:「Huang」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/14794122/rotating-uibutton-while-rotating-parentview-they-reside-with-in