I'm making a 2 player game where you play on either side of the iPhone and I need to have upside down buttons. Any ideas on flipping them around?
A:
One way is to set the transform
property of UIView
. You can do many types of transforms, but a rotation of 180 degrees will flip it for you.
// angle is radians, so convert degrees to radians
float degrees = 180.0;
view.transform = CGAffineTransformMakeRotation( degrees / 180.0 * M_PI );
Colin Gislason
2010-08-05 15:44:37
In dont want to rotate the whole view. Could I replace `view.transform` with my button/label name?
2010-08-05 15:51:46
I tried it and it worked.
2010-08-05 16:09:46
shorty876: Pay attention to superclasses. Buttons and labels are views just as much as the view your view controller owns directly is.
Peter Hosey
2010-08-05 20:49:55