Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- <string>UIInterfaceOrientationLandscapeLeft</string>
- <string>UIInterfaceOrientationLandscapeRight</string>
- </array>
- //deprecated
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
- return (interfaceOrientation == UIInterfaceOrientationPortrait);
- }
- - (NSUInteger)supportedInterfaceOrientations{
- return UIInterfaceOrientationMaskPortrait;
- }
- - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
- @interface MyTabBarController : UITabBarController
- {
- }
- @end
- @implementation MyTabBarController
- // put your shouldAutorotateToInterfaceOrientation and other overrides here
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
- return (interfaceOrientation == UIInterfaceOrientationPortrait);
- }
- - (NSUInteger)supportedInterfaceOrientations{
- return UIInterfaceOrientationMaskPortrait;
- }
- @end
- - (BOOL)shouldAutorotate;
- {
- return YES;
- }
- - (NSUInteger)supportedInterfaceOrientations
- {
- if ([[self topViewController] respondsToSelector:@selector(supportedInterfaceOrientations)])
- return [[self topViewController] supportedInterfaceOrientations];
- else
- return [super supportedInterfaceOrientations];
- }
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
- return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft
- || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement