landscape

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

℡╲_俬逩灬. 提交于 2019-11-28 04:20:23
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? Hazem Farahat 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: http://developer.android.com/reference/android/content/res/Configuration.html#orientation Thanks

AS3 - iOS force landscape mode only?

六月ゝ 毕业季﹏ 提交于 2019-11-28 04:04:49
问题 I've built a game for iOS that is designed for landscape mode and it works just fine except that if you turn the device to portrait mode it stops there to with the interface only filling about the middle half of the screen. How can I force the app to only allow the two landscape modes and not stop at the portrait position. I've tried all the publishing settings. Aspect Ratio is set for Landscape and Auto Orientation is checked on, if I uncheck AUto Orientation that the app does not rotate to

How to detect landscape left (normal) vs landscape right (reverse) with support for naturally landscape devices?

心不动则不痛 提交于 2019-11-28 02:55:56
问题 What I would like to do: Detect the current layout orientation of the device (Portrait, Landscape-Left, Portrait(upside down), Landscape-Right) Differentiate between the two possible landscape modes (leaning on the left side, leaning on the right side) Support devices that have landscape as their natural state (for example, discussed here) Support < 2.2 (can't use getRotation()) Just to clarify, I want to know what orientation the layout is currently in. Which direction is the bottom of the

fix the orientation on page to landscape only in Jquery-mobile

百般思念 提交于 2019-11-28 01:37:50
How can the orientation of a page be landscape only as i am using jquery mobile for my webapp? The page contains some tabular data which can't be shown in the portrait mode in the mobile version... Take a look of my layout.. http://jsfiddle.net/nY5ZF/1/ Can this be fixed??? We now have responsive tables in jquerymobile 1.3.1, you could use that... http://jquerymobile.com/demos/1.3.0-beta.1/docs/tables/ As its not possible to lock the orientation in webapps unlike hybrid apps (phonegap). Some browsers just do not help us in that. Next you could display this data in list format OR just check the

Force Landscape Orientation on iOS 6 in Objective-C

Deadly 提交于 2019-11-27 22:23:15
问题 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

uiwebview not resizing after changing orientation to landscape

时间秒杀一切 提交于 2019-11-27 21:48:22
问题 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

css expanding based on portrait or landscape screen size?

*爱你&永不变心* 提交于 2019-11-27 20:38:16
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? 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 are looking into, but CSS3 provides exactly what you want with CSS3 Media Queries . With CSS3 you have fun

iPhone Landscape-Only Utility-Template Application

↘锁芯ラ 提交于 2019-11-27 13:21:58
问题 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

Force portrait orientation while pushing from landscape View Controller

别来无恙 提交于 2019-11-27 12:39:27
App Support: iOS6+ My app works in both portrait and landscape. But 1 controller should only works in a Portrait. The problem is that when I am in landscape and push the view controller the new viewcontroller is in landscape as well until I rotate it to portrait. Then it's stuck in portrait as it should be. Is it possible to always make it appear in portrait? Even if its parent is pushing it in landscape? All the following code doesn't help [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait]; And this code works until and unless i am not pushing from

force landscape ios 7

[亡魂溺海] 提交于 2019-11-27 12:14:25
I've tried to following methods to force landscape on one my views: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeLeft; } - (BOOL)shouldAutorotate{ return YES; } Neither did work. Note that I'm testing on the simulator and on an iPad. Thanks diogo.appDev Here is how I forced one of my views to be Landscape using NavigationViewController: Implemented this answer: https://stackoverflow.com/a/12662433/2394787 Imported message in the View