portrait

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

Xcode: Need to lock game to portrait only

亡梦爱人 提交于 2019-11-28 04:16:39
问题 I just released a game to the app store and realized I completely forgot to lock it to portrait only. I need to submit an updated version that does just that. At this point, is it enough to just go to general > deployment info and uncheck everything but Portrait and then submit this as a new build? Or do I also need to do something to the code? Please note that it's a swift app. 回答1: Simple. Here's how you do it. This works for both objective c and swift. 1. Open your project and go do your

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

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

Camera : setDisplayOrientation function is not working for Samsung Galaxy ACE with Android 2.3.6

為{幸葍}努か 提交于 2019-11-27 11:57:36
I was trying to create a simple camera application for research. I Read Android Camera Official Document and then started coding. so I did some steps to get it work 1.Added required permissions for Camera feature in app. 2.locked my activity to PORTRAIT mode only. setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 3.Added several camera callbacks to get my camera works. SurfaceHolder.Callback, Camera.PreviewCallback AutoFocusCallback ShutterCallback PictureCallback for RAW image data PictureCallback for JPG image data 4.In surfaceChanged method I am customizing camera settings.

Lock Android phone application to Portrait mode

夙愿已清 提交于 2019-11-27 10:12:38
问题 Can someone tell me how to lock my application to a portrait mode? Is it a simple configuration in the manifest file? 回答1: Yes. Add android:screenOrientation="portrait" to the manifest under your main activity. <activity android:name=".yourActivity" android:screenOrientation="portrait"... /> 回答2: Yes! It's an attribute of the activity tag: <activity android:name=".yourActivity" android:screenOrientation="portrait" ... /> 回答3: Also, you may have to add the following to your activity element:

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

Camera : setDisplayOrientation function is not working for Samsung Galaxy ACE with Android 2.3.6

梦想的初衷 提交于 2019-11-27 04:04:30
问题 I was trying to create a simple camera application for research. I Read Android Camera Official Document and then started coding. so I did some steps to get it work 1.Added required permissions for Camera feature in app. 2.locked my activity to PORTRAIT mode only. setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 3.Added several camera callbacks to get my camera works. SurfaceHolder.Callback, Camera.PreviewCallback AutoFocusCallback ShutterCallback PictureCallback for RAW

Android: Camera preview orientation in portrait mode

ε祈祈猫儿з 提交于 2019-11-27 02:16:31
问题 I'm using the camera to show preview only (not to take pictures or record videos). The app is always in portrait mode (landscape mode is disabled). The camera preview is always rotated 90 degrees ccw and I can't change it (neither with setDisplayOrientation nor with p.set("orientation", "portrait" ) and p.set("rotation", 90) ) . Is the preview ALWAYS rotated like this or is it device dependent? If it was always like this in portrait mode, I could just rotate the image afterwards. Or is there

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: