screen-rotation

iOS 6 rotations: supportedInterfaceOrientations doesn´t work?

百般思念 提交于 2019-11-27 17:59:41
I´m having this issue with iOS 6 SDK: I´m having some views that should be allowed to rotate (e.g. a videoview), and some that don´t. Now I understand I have to check all orientations in the app´s Info.plist and then sort out in each ViewController, what should happen. But it doesn´t work! The app always rotates to the orientations, that are given in the Info.plist. Info.plist: <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> any

Avoid Android VideoView corruption when rotating back to portrait

拈花ヽ惹草 提交于 2019-11-27 08:29:00
I've managed to write a limited video player able to view a .3gp file from internet. The video will be shown centered full screen, maintaining the video aspect ratio. Also, rotations don't interrupt the video, which keeps playing without problems. Everything seems fine, but... on my HTC Legend when you rotate back to portrait, the video is corrupted, and instead of showing full screen it is displayed at its native pixel size. But rotating again to landscape works and is shown perfectly. Any ideas why? Unfortunately I don't have more hardware to test this on and I've run out of ideas to test.

How do I detect screen rotation

ぃ、小莉子 提交于 2019-11-27 05:02:22
I have an activity that is showing a compass, and I need to know the orientation of the screen to properly rotate the needle. I need to distinguish between 90° and 270° degree rotation to properly handle this. When I rotate the screen (on my Nexus S at least) the activity's onCreate gets called, e.g. when I rotate from portrait to landscape mode. When I rotate from one landscape mode to the other with the top edge raised, onCreate() gets called twice (once for portrait orientation and once for the target landscape mode). However, when I rotate with the bottom edge up, the screen rotates 180°

How to maintain presenting view controller's orientation when dismissing modal view controller?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 03:56:49
I have this app I am working on and I need ALL my view controllers but one to be in portrait. The single one view controller that is special I need it to be able to rotate to whatever orientation the phone is in. To do that I present it modally (not embedded in a NavigationController) So (for example) my structure is like this: window - Portrait root view controller (UINavigationController - Portrait) home view controller (UIViewController - Portrait) details view controller (UIViewController - Portrait) . . . modal view controller (UIVIewController - All) Now when ever I dismiss my modal view

PhoneGap - Forcing Landscape orientation

橙三吉。 提交于 2019-11-26 16:37:21
I started looking into PhoneGap yesterday and created a simple "marble" rolling around while tilting the phone. I am currently developing on Android but I want the orientation to stay as landscaping instead of moving when the phone gets spun around. Is there a way of doing this? Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.phonegap.helloworld" android:versionCode="1" android:versionName="1.0" > <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android

Avoid Android VideoView corruption when rotating back to portrait

前提是你 提交于 2019-11-26 14:09:07
问题 I've managed to write a limited video player able to view a .3gp file from internet. The video will be shown centered full screen, maintaining the video aspect ratio. Also, rotations don't interrupt the video, which keeps playing without problems. Everything seems fine, but... on my HTC Legend when you rotate back to portrait, the video is corrupted, and instead of showing full screen it is displayed at its native pixel size. But rotating again to landscape works and is shown perfectly. Any

How to save custom ArrayList on Android screen rotate?

旧时模样 提交于 2019-11-26 12:10:33
I have an ArrayList with custom objects that I would like to be able to save and restore on a screen rotate. I know that this can be done with onSaveInstanceState and onRestoreInstanceState if I were to make the ArrayList its own class, which implements either Parcelable or Serializable ... But is there a way to do this without creating another class? You do not need to create a new class to pass an ArrayList of your custom objects. You should simply implement the Parcelable class for your object and use Bundle#putParcelableArrayList() in onSaveInstanceState() and onRestoreInstanceState() .

RecyclerView: Inconsistency detected. Invalid item position

﹥>﹥吖頭↗ 提交于 2019-11-26 11:31:20
Our QA has detected a bug: when rotating the Android device (Droid Turbo), the following RecyclerView-related crash happened: java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 2(offset:2).state:3 To me, it looks like an internal error inside RecyclerView, as I can't think of any way of this being caused directly by our code... Has anyone encountered this problem? What would be the solution? A brutal workaround could be perhaps to catch the exception when it happens and re-create the RecyclverView instance from scratch, to avoid getting left with a corrupted

How do I detect screen rotation

十年热恋 提交于 2019-11-26 11:26:13
问题 I have an activity that is showing a compass, and I need to know the orientation of the screen to properly rotate the needle. I need to distinguish between 90° and 270° degree rotation to properly handle this. When I rotate the screen (on my Nexus S at least) the activity\'s onCreate gets called, e.g. when I rotate from portrait to landscape mode. When I rotate from one landscape mode to the other with the top edge raised, onCreate() gets called twice (once for portrait orientation and once

How to maintain presenting view controller&#39;s orientation when dismissing modal view controller?

末鹿安然 提交于 2019-11-26 10:58:03
问题 I have this app I am working on and I need ALL my view controllers but one to be in portrait. The single one view controller that is special I need it to be able to rotate to whatever orientation the phone is in. To do that I present it modally (not embedded in a NavigationController) So (for example) my structure is like this: window - Portrait root view controller (UINavigationController - Portrait) home view controller (UIViewController - Portrait) details view controller (UIViewController