Created
December 8, 2010 04:00
-
-
Save marshluca/732861 to your computer and use it in GitHub Desktop.
willRotateToInterfaceOrientation:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration { | |
CGRect apprect; | |
apprect.origin = CGPointMake(0.0f, 0.0f); | |
if ((orientation == UIInterfaceOrientationLandscapeLeft) || (orientation == UIInterfaceOrientationLandscapeRight)) | |
apprect.size = CGSizeMake(480.0f, 300.0f); | |
else | |
apprect.size = CGSizeMake(320.0f, 460.0f); | |
// Iterate through the subviews and inset each item | |
float offset = 32.0f; | |
for (UIView *subview in [self.view subviews]) | |
{ | |
CGRect frame = CGRectInset(apprect, offset, offset); | |
[subview setFrame:frame]; | |
offset += 32.0f; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment