screen-orientation

Is it possible to have different orientations for viewControllers inside UINavigationController?

我怕爱的太早我们不能终老 提交于 2019-12-07 15:02:34
问题 I want all view controllers to support only portrait mode, except one view controller lets call it "LandscapeSupportViewController" that should support also landscape mode. The problem is when I'm in LandscapeSupportViewController in landscape mode and then push a new view controller that only support portrait mode, the pushed view controller will be in landscape mode also! How could I force it to be portrait? I saw few apps that do it, take for example Skype iPhone app, the Messages tab is

How do you prevent the android screen from being turned sideways?

烂漫一生 提交于 2019-12-07 13:46:33
Whenever I turn the device sideways, everything in my app also turns and becomes distorted. How do I lock it into vertical? In your AndroidManifest.xml set the orientation on your Activity to portrait like this. <activity android:name=".YourActivity" android:label="@string/app_name" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> Whenever I turn the device sideways, everything in my app also turns and becomes distorted. How do I lock it into

AdView bug causing all webviews stop loading when orientation changes and multi-threads are running?

假装没事ソ 提交于 2019-12-07 11:39:06
问题 I just found a problem with Adview when screen orientation changes and multi-threads are running. I think this might be a bug of Adview. And this problem impacts all the webviews in the application. The webviews stop loading any content, i.e. they either show blank or the content that was shown before. The test environment is Platform: Google Nexus S + Android 4.1.2 (not only this platform, a lot of other platforms, even the emulators are affected) Ads SDK: 6.4.1 (we also tested Ads SDK 4.1.1

How to change screen orientation, without creating a new activity on android?

折月煮酒 提交于 2019-12-07 08:08:40
问题 I do not know if the title is correct, here is what happens. I have an application which works differently on a phone and on a tablet, on a phone it shows as portrait on a tablet it shows as landscape. To achieve this I created a class called CoreActivity which is extended by all my activities and does the following: public class CoreActivity extends Activity { protected boolean _landscape = false; public boolean isPhone() { int layoutSize = getScreenLayoutSize(); return (layoutSize ==

onSurfaceChanged called twice

别来无恙 提交于 2019-12-07 05:23:43
问题 I'm creating an Android application using openGL ES, and I have following problem: When I minimize the application, then reopen it, onSurfaceChanged in my GLSurfaceView.Renderer is called 2 times. I have the following code in onSurfaceChanged (and similar code in onSurfaceCreated,onDrawFrame): Log.e("onSurfaceChanged",Integer.toString(width)+" "+Integer.toString(height)); So I get the following log: onSurfaceCreated onSurfaceChanged 480 800 onDrawFrame onSurfaceChanged 480 800 onDrawFrame

android:screenOrientation=“sensorPortrait” doesn't work on API +17

ぃ、小莉子 提交于 2019-12-07 05:15:30
问题 I want my application to work in Portrait & reversePortrait mode .. In other words, I want it to work in portrait and make it rotatable 180 degrees! I'm using the following code within <activity> tag of the MainActivity in the Manifest. android:screenOrientation="sensorPortrait" However, this seems to work only on Android 4.1.2 and backward. It doesn't work on Android 4.2.2 and above! I tried on different phones, the same result! How to solve it? 回答1: I'm aware of a typo error by Google that

Application Crashes on orientation change while showing Progress Bar in AsyncTask

房东的猫 提交于 2019-12-06 17:45:30
I have an application which uses AsyncTask to get the json file from server and so shows the Progress Bar. But while showing the progress bar and the orientation is changed, the application crashes showing VIEW NOT ATTACHED error or HAS LEAKED WINDOW error . How to get rid of these errors? Otherwise the application works fine on AsyncTask. Try this for your activity. Although it is not very clean. It can help <activity android:configChanges="orientation|screenSize" android:name=".activity.MyActivity" ></activity> Well what about "locking" the screen-orientation while your AsyncTask is running?

What's the best way to detect orientation using CSS media queries?

人走茶凉 提交于 2019-12-06 15:29:51
问题 What's the most reliable way to detect a device's orientation using CSS @media queries? I tried these: @media screen and (orientation: portrait) @media screen and (orientation: landscape) but they don't work in all cases. On some Android devices, showing the keyboard in portrait mode can make it use the "orientation: landscape" query, since the aspect ratio is more than 1/1. I've seen suggestions to use this instead: @media screen and (max-aspect-ratio: 13/9) // portrait @media screen and

no orientation notification when translucent set

可紊 提交于 2019-12-06 13:47:44
Using phones that have android 2.1 & 2.2 installed, using the simplest case of a hello world app and add android:theme="@android:style/Theme.Translucent" to the activity in the android manifest to have the app be transparent, the app sticks as portrait only and won't rotate to landscape when the phone is rotated. Take the line out and the app rotates ok. This is verified by adding the override of onConfigurationChanged and putting a breakpoint in that routine. Brk hits when translucent isn't applied, doesn't when you add translucency. However, using a samsung galaxy tab using andr 2.2 ,

UIImagePickerController shows black bar when zooming – Is this a bug in iOS?

我们两清 提交于 2019-12-06 13:39:25
Edit : It has been suggested this post is a duplicate , which is not the case as the black bars are not initially present an an affine transformation does not remedy the problem. I run this on an iPad Air 2 and target iOS 8. I have a UIImagePickerController whose showsCameraControls property is set to NO . When starting the app in landscape and then zooming in, this is what happens (all images are non-cropped): A black bar appears and can be gotten rid of by changing device orientation to portrait (which will also show the black bar) and then changing it back. After change to portrait: Back to