I'm trying to create an application for the iPad, but I encounter dubious behavior using a simulator (at the moment you can not test on the device ..).
The problem is that any UIView rotates through its transform property, and then allows you to view the view containing it by changing the orientation of the iPad. This can be simplified by creating a new iPad project based on View and entering the following code into the view controller:
- (IBAction) rotate:(UIView*)sender {
if (CGAffineTransformIsIdentity(sender.transform)) {
sender.transform = CGAffineTransformMakeRotation(M_PI / 4);
} else {
sender.transform = CGAffineTransformIdentity;
}
}
Then adding one button to the view and associating its action with the above method.
As you can see, the method should rotate the button when pressed, and then rotate again when pressed again - and this is done just like that. However, when the button rotates and you change the orientation (from the "Equipment" menu), it will start acting very strange - changing its shape or even disappearing.
It is worth noting that if I create a translation transformation, this will not happen.
My question is:
1. Since I do not have an iPad at the moment (working on this), can someone tell me that this is happening on the device as well? 2. Am I doing something wrong? Maybe this is not a way to rotate the UIView? If so, then what?
. , [transform] , frame undefined . , , , , autoresizeMask transform. , ?
,
Aviad.