landscape

How to restrict my app to landscape mode?

自作多情 提交于 2019-11-27 10:37:58
问题 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?

Force landscape mode in one ViewController using Swift

不羁岁月 提交于 2019-11-27 09:40:11
问题 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

Webview resizes automatically to portrait and landscape view in iphone

南笙酒味 提交于 2019-11-27 05:52:45
问题 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

Orienting iOS splash image to landscape/portrait according to launch orientation

蹲街弑〆低调 提交于 2019-11-27 05:38:18
问题 I have an app that can launch in portrait or landscape. I'd like the Default.png file (the splash image that appears when the app launches) to show the image in the correct orientation so I expect I'd need to use two different images (different dimensions). I don't know how to make the app pick which image to use based on its launching orientation, however. Is this possible? Is there any way to know what orientation the app is launching in (before the splash is shown) and then pick the

UIWindow with wrong size when using landscape orientation

半城伤御伤魂 提交于 2019-11-27 01:36:50
问题 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

UIPicker sizing in landscape mode

吃可爱长大的小学妹 提交于 2019-11-27 00:31:49
问题 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. 回答1: 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]

Find out if Android device is portrait or landscape for normal usage?

痞子三分冷 提交于 2019-11-27 00:21:06
问题 Is there anyway to find out if a device is portrait or landscape by default? In that I mean how you normally use the device. Most phones have a portrait screen for normal usage but is there some flag for finding that out? 回答1: You can do this by: For Lanscape if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){ //Do some stuff } For Portrait if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){ //Do some stuff } Check:

jQuery Mobile lock orientation

南笙酒味 提交于 2019-11-26 22:56:51
Hey guys i'm using phonegap and jquery mobile to build an app for an android phone. Is there a possibility to lock the orientation on one page? E.g. page "map" is loaded and the orientation is locked to "landscape" mode. Not really i think. In xCode for iOS apps is it not possible. The only fix I can come up with, is to rotate your body or a wrapper acording to window.orientation $(window).bind("orientationchange", function(){ var orientation = window.orientation; var new_orientation = (orientation) ? 0 : 180 + orientation; $('body').css({ "-webkit-transform": "rotate(" + new_orientation +

Crash on presenting UIImagePickerController under iOS 6.0

两盒软妹~` 提交于 2019-11-26 21:42:20
My app only supports landscape orientations via the supportedInterfaceOrientation properties. Using an iOS prior to iOS 6, my app can successfully load an instance of UIImagePickerController via presentViewController:animated:completion: even though the UIImagePickerController itself only supports portrait orientation. The image picker simply presented itself sideways to the user. The user rotated the phone, picked their image, and then rotated back to landscape. Under iOS 6.0, calling presentViewController:animated:completion: with the UIImagePickerController instance crashes the app. I can

css expanding based on portrait or landscape screen size?

限于喜欢 提交于 2019-11-26 20:24:47
问题 I have two divs that are floating next to each other. What i would like is to have it have a width of 100px when you are looking at it in portrait mode and lets say 200 px in landscape. This happens viewing on a mobile device actually. So the div will expand when in landscape mode and shrink up a bit in portrait. Any ideas? 回答1: Well this is not possible with CSS2, but it would be possible to do what you want with Javascript (read out the screen size etc.). I'm not sure what technology you