landscape

Force Landscape Orientation on iOS 6 in Objective-C

你。 提交于 2019-11-29 04:26:55
I have a master view controller that's inside a UINavigationController. In that master view controller, I have a button that pushes a detail view controller that has a UIWebView inside of it. I want this detail view controller to be on landscape mode when it's loaded. Going back to the master view controller, it forcibly goes back again to portrait mode. I'm running iOS 6 on this. I have seen the other similar questions but it's not working on my end. I have created a LandscapeViewController that's a subclass of UIViewController where I have written these methods: #pragma mark - Orientation

uiwebview not resizing after changing orientation to landscape

℡╲_俬逩灬. 提交于 2019-11-29 02:08:07
I'm coding an iPhone app in which I have a UIWebView that loads a website with a responsive design. The problem I have is when I rotate the devices to landscape: the UIWebView rotates but it keeps the same width as the portrait mode. I spent the last 5 hours searching all over the net, I found some solutions that I used but without success... in my html page i'm using <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> i tried using <meta name="viewport" content="width=device-width" /> nothing changed, in my code I'm implementing the

Storyboards orientation support for xCode 4.2?

最后都变了- 提交于 2019-11-28 23:30:04
I upgraded to xCode 4.2 and it's new Storyboards feature. However, could not find a way to support both portrait and landscape. Of course, I did it programmatically, with 2 views, one for portrait and one for landscape, like in old days, and: if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { self.view = self.landscapeView; } else { self.view = self.portraitView; } But I was looking for a way to do this automatically somehow. I mean, it's xCode 4.2 now, I expected more from it. Thanks all. =========================

iPhone Landscape-Only Utility-Template Application

匆匆过客 提交于 2019-11-28 20:58:13
I'm trying to create an iPhone application that is always in landscape mode, using the Utility application template. Here's what I did: Create a new iPhone application project, using the Utility Application template In Interface Builder, rotate all the views 90 degrees. In Interface Builder, add a label to the middle of the MainView. Stretch it all the way across the view, set the alignment to centered, and set the autosizing springs so that it can stretch horizontally. In Info.plist, add the key "UIInterfaceOrientation" with value "UIInterfaceOrientationLandscapeRight" In the controller

How to restrict my app to landscape mode?

安稳与你 提交于 2019-11-28 17:39:05
I have my iPad application created using the SplitView template. I wonder what is the best way to restrict my application to landscape mode? I have tried overriding shouldAutorotateToInterfaceOrientation: method in DetailViewController.m - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return UIInterfaceOrientationIsLandscape(interfaceOrientation); } but 4.2 GM is still buggy and it fails to show the controller view. What other choices do I have? Thanks in advance. UPDATE1 I have already filed a bug report: Bug ID #8620135 My app is almost finished

Force landscape mode in one ViewController using Swift

ぐ巨炮叔叔 提交于 2019-11-28 16:38:07
I am trying to force only one view in my application on landscape mode, I am calling override func shouldAutorotate() -> Bool { print("shouldAutorotate") return false } override func supportedInterfaceOrientations() -> Int { print("supportedInterfaceOrientations") return Int(UIInterfaceOrientationMask.LandscapeLeft.rawValue) } override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation { return UIInterfaceOrientation.LandscapeLeft } The view is launched in the portrait mode, and keep rotating when I change the device orientation. The shouldAutorotate is never called.

Webview resizes automatically to portrait and landscape view in iphone

旧城冷巷雨未停 提交于 2019-11-28 10:21:38
I am new to iphone development.In my app, i want to display the web view in device with c portrait Orientation.It should also support landscape orientation. I used the below method but there is no expected output. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); } please guide me.Please help me out.Thanks I think you have set the fixed frame for webview.That

UIWindow with wrong size when using landscape orientation

回眸只為那壹抹淺笑 提交于 2019-11-28 06:55:15
I have an empty application and there is no storyboard or xib involved. I want to have a hidden status bar and support only landscape orientation. Again, I wan't to make those changes only within code and don't touch the Info.plist. Problem I create a UIWindow with a controller that says the only supported orientation is landscape. In that case my UIWindow is created in the dimension of portrait mode and doesn't rotate. The expected result would be a screen that is completely cyan. This is my delegate: #import "AppDelegate.h" #import "AppViewController.h" @implementation AppDelegate - (BOOL

tabBarController and navigationControllers in landscape mode, episode II

你。 提交于 2019-11-28 05:35:12
I have a UITabBarController, and each tab handles a different UIViewController that pushes on the stack new controllers as needed. In two of these tabs I need, when a specific controller is reached, the ability to rotate the iPhone and visualize a view in landscape mode. After struggling a lot I have found that it is mandatory subclassing UITabBarController to override shouldAutorotateToInterfaceOrientation. However, if i simply return YES in the implementation, the following undesirable side effect arises: every controller in every tab is automatically put in landscape mode when rotating the

UIPicker sizing in landscape mode

陌路散爱 提交于 2019-11-28 04:35:57
I am trying to develop an app with a UIPicker in landscape mode, taking up (almost) the entire width of the screen (with 5 or 6 components). Can you please tell me how to set the size of UIPicker. Thank you very much for your help. Actually, I resize my pickers for almost every app. I do not like that they take up the entire screen. Here is the method that I am using: (note that I am also rotating the picker to be horizontal) in viewDidLoad ..... picker = [[UIPickerView alloc] initWithFrame:CGRectZero]; picker.delegate = self; picker.dataSource = self; picker.showsSelectionIndicator = NO; /