uiinterfaceorientation

iOS 8.3 supported orientations crashs

白昼怎懂夜的黑 提交于 2019-11-30 07:14:40
问题 I have a big problem with my app and iOS 8.3. I have many crashes with always the same error: Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [... shouldAutorotate] is returning YES When "..." are many classes. A particular problem is the class UIAlertView, I have the same problem of UIAlertView crashs in iOS 8.3 but I can't resolve subclassing UIAlertView (Apple says that

iPad orientation change issue

心不动则不痛 提交于 2019-11-30 05:19:53
My iPhone application is displaying some odd behavior when run on the iPad with respect to supporting orientation changes. The app starts up with a view controller (call it view A for the sake of argument) and navigation controller, and shouldAutorotateToInterfaceOrientation is returning YES for portrait only. Onto the navigation controller, I push a view controller (view B) that also returns YES for portrait only. Then, I push another view controller (view C) onto the nav controller that supports all rotations and adjusts the items on screen based on the orientation to rotate to. When this is

Play video fullscreen in landscape mode, when my entire application is in lock in portrait mode

[亡魂溺海] 提交于 2019-11-29 21:09:19
问题 I want to play video in landscape mode in fullscreen. And my application is lock in portrait mode. How to implement this. Please help me. Thanks in advance 回答1: I've done this in on of my app. To do this you need to check that is your viewcontroller that where you want to play a video. The first thing you have to do is check Device Orientation to Portrait,Landscape left, Landscape right in your project target In your AppDelegate do the below code -(NSUInteger)application:(UIApplication *

how to provide only one view with landscape for MPMoviePlayerController in IOS6

北城余情 提交于 2019-11-29 17:58:42
i had spend 2 hours finding the correct code to fix my orientation problem this are my movieplayer code. i need this particular view to be shown in landscape. in appdelegate i set all orientation and in my rootviewcontroller i set is as portrait only and in my movieplayer view as landscape but not luck. can anybody give me some comment on how to fix the issues please ? - (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window { return UIInterfaceOrientationMaskAll; } my rootviewcontroller - (BOOL)shouldAutorotate { return NO; } -

iPad Landscape and Portrait different layouts with Size Class

最后都变了- 提交于 2019-11-29 16:53:03
问题 How to design iPad Landscape and Portrait screens with different Layouts using Size class. I could find only w-regular and h-regular for both orientations. Example: I need to align 2 views vertically in portrait and horizontally in landscape using Size Class 回答1: Finally I found a solution : if traitCollection.verticalSizeClass == .Regular && traitCollection.horizontalSizeClass == .Regular { var orientation:UIInterfaceOrientation = UIApplication.sharedApplication().statusBarOrientation; if

IO6 doesn't call -(BOOL)shouldAutorotate

独自空忆成欢 提交于 2019-11-29 15:45:57
问题 I have some views in my app that I don't want to suport orientation. In didFinishLaunchingWithOptions I add navigation: ... UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:self.viewController]; self.window.rootViewController = nav; [self.window makeKeyAndVisible]; ... In each ViewController I have UITabBar (I don't know if this is important). In the first view controller I add: -(BOOL)shouldAutorotate { return NO; } - (NSUInteger

iOS - Lock a specific UIViewController to a specific orientation [closed]

半城伤御伤魂 提交于 2019-11-29 15:31:58
My application supports every 4 orientation, I have a UIViewController which is in LandscapeRight . I am using UINavigationController to push that UIViewController , i want that UIViewController to be only in UIInterfaceOrientationLandscapeRight but when I rotate the phone, it switches back to other Orientation. -(BOOL)shouldAutorotate{ return NO; } -(NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationLandscapeRight; } -(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{ return UIInterfaceOrientationLandscapeRight; } Siu Chung Chan just remove those

MPMoviePlayerController should only in landscape mode

戏子无情 提交于 2019-11-29 15:19:04
I am using the MPMoviePlayerController in my application to play videos. My application is working only in portrait mode. and I want application video should only play in landscape mode only. So please can any one suggest how i do this. Right now my video is playing in Portrait mode. For doing this, You need to subclass the MPMoviePlayerController class. @interface yourMovie:MPMoviePlayerController { } @end and you need to implement the shouldAutoRotate method in the implementation and return only landscape mode @implementation yourMovie - (BOOL)shouldAutorotate { return [[UIDevice

AutoLayout uitableviewcell in landscape and on iPad calculating height based on portrait iPhone

流过昼夜 提交于 2019-11-29 15:08:50
问题 I'm learning / experimenting with autolayout and UITableViewCell 's. I asked another question a few days ago to which I answered my own question, I'm still using the same constraints / code. For the full code see here: AutoLayout multiline UILabel cutting off some text . To cut it short inside heightForRowAtIndexPath I am using an instance of a custom UITableViewCell to calculate the height the row needs to be. This works perfect in portrait, however when I switch to landscape mode,

How do I restrict orientation per view controller in iOS7 in a navigation controller hierarchy

谁说胖子不能爱 提交于 2019-11-29 04:27:48
My app is a UITabBarController --> UINavigationController --> UITableViewController --> UIViewController. I want to do 2 things: Prevent my tableview from rotating, I want it to always stay portrait. FORCE & Allow my UIViewcontroller to rotate landscapeleft. What I know: I understand that the viewcontroller at the top of the hierarchy controls rotation. This would be my UITabBarController? Or rather its only viewcontroller which would be at objectIndex:0? My project settings allow for Portrait, LL and LR rotations. Im thinking this is the pattern I need to follow in order to solve this is