Created
August 17, 2011 05:45
-
-
Save chrishulbert/1150882 to your computer and use it in GitHub Desktop.
Resize things programmatically for landscape/portrait in iphone/objc
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
| // Resize the controls | |
| - (void)doMyResizing { | |
| // Resize some stuff here | |
| self.something.frame = something... | |
| } | |
| - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { | |
| [self doMyResizing]; | |
| } | |
| - (void)viewWillAppear:(BOOL)animated { | |
| [super viewWillAppear:animated]; | |
| [self doMyResizing]; // This is for some cases when the person uses this tab in portrait, changes to another tab, rotates to landscape, and switches back to this | |
| } | |
| - (void)viewDidAppear:(BOOL)animated { | |
| [super viewDidAppear:animated]; | |
| [self doMyResizing]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment