setting default orientation for iPhone and iPad.

restricted iPhone to landscape mode only.
This commit is contained in:
techdragon.nguyen@gmail.com
2011-05-10 12:37:41 +00:00
parent aed68a2cd9
commit ac6fd6bbf8
4 changed files with 18 additions and 9 deletions

View File

@@ -64,11 +64,16 @@
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
bool isSmallScreen = (UI_USER_INTERFACE_IDIOM()) == UIUserInterfaceIdiomPhone;
if ( isSmallScreen && UIInterfaceOrientationIsPortrait(interfaceOrientation))
return NO;
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
UIDeviceOrientation currentDeviceOrientation = [UIDevice currentDevice].orientation;
UIInterfaceOrientation currentInterfaceOrientation = self.interfaceOrientation;