screen-rotation

iOS button tap area after device rotation

。_饼干妹妹 提交于 2019-12-11 06:24:25
问题 I'm having trouble with a couple of buttons after rotation. When in portrait mode, the buttons are stacked at the bottom of the screen. When in landscape, they are moved and resized to be side-by-side at the bottom of the screen. This all works great and the buttons behave correctly. However, if the phone is then rotated back to portrait, the buttons' tap area is wrong - only the left 1/3 of the buttons is tappable. Here's the code that does the rotation. (I call it within viewWillAppear as

Android Screen Orientation Change Causes App To Quit

和自甴很熟 提交于 2019-12-11 05:48:45
问题 I have an app that I set to only display in Portrait mode by setting android:screenOrientation="portrait" for each Activity in the manifest. This works fine and my app screen does not rotate when I rotate the phone. The problem is, if I start the app with the phone in Portrait orientation, then as my first Activity runs (an animated splash screen) and I rotate the phone to Landscape while the first Activity is still running, when the next activity is launched (it is launched from the finally

How to prevent the screen from automatically rotating on a tablet?

为君一笑 提交于 2019-12-10 14:54:54
问题 In the link below, Microsoft describes two ways to limit rotation of an application screen on a tablet. http://msdn.microsoft.com/en-ca/library/windows/apps/hh700342.aspx what's happening is that delphi's (XE3) TRibbon doesn't handle rotation well. it tends to get hung. as would be expected, the MS web site describes how to do this from MS development products. I don't see how I can do this in my Delphi project. Method 1: add this to your appxmanifest file: <InitialRotationPreference>

Android Dialog reopen after rotate device

北城以北 提交于 2019-12-10 10:32:32
问题 I'm writing a very simple application to open my custom share dialog. XML layout contains only 1 button: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/white" android:gravity="center_horizontal"> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin=

Fragment calling fragments loosing state on screen rotation

若如初见. 提交于 2019-12-08 13:19:01
问题 Hi i created a project with a default "Navigation Drawer Activity". So i have a MainActivity with a fragment with is replaced for each item on menu. One of the menus is "Customers" with shows a list of customers. From customers fragment i can see the Interests of this customers, with is a Fragment(CustomerListFragment) calling the interests(InterestsListFragment). There is even more levels, but to be short that's enough. This is the code on MainActivity that i use to call fragment from

How to save/restore(update) ref to the dialog during screen rotation?(I need ref in onCreate method of activity.)

老子叫甜甜 提交于 2019-12-08 12:24:41
问题 protected Dialog onCreateDialog(int id) { ... AlertDialog.Builder adb = new AlertDialog.Builder(this); ... mydialog = adb.create(); ... } But onCreateDialog runs after onCreate. 回答1: If you want to be backwards compatible, you do it as follows. class MyActivity extends Activity { protected static final class MyNonConfig { // fill with public variables keeping references and other state info, set to null } private boolean isConfigChange; private MyNonConfig nonConf; @Override protected void

Swift manually rotate view controller

柔情痞子 提交于 2019-12-08 04:23:26
So I'm working on an iOS 10 app using Swift 3 and Xcode 8.3.3. In my app I have to take successively 8 pictures with indicators on the camera. So I'm using AVCaptureVideoPreviewLayer for the custom camera and I need to set the view displaying the camera on landscape mode. I did it using this extension that I found on stackoverflow while searching for the problem. struct AppUtility { static func lockOrientation(_ orientation: UIInterfaceOrientationMask) { if let delegate = UIApplication.shared.delegate as? AppDelegate { delegate.orientationLock = orientation } } /// OPTIONAL Added method to

Android Front Camera recording video but plays upside down…!

淺唱寂寞╮ 提交于 2019-12-07 17:55:50
I have managed to create an android application to record videos but the problem is with the orientation of front camera video . The output is not the as per requirements . It gets automatically rotated . Application orientation is landscape . So, I need to record using front cam in landscape mode. Nothing is working out . You might want to look at how the AOSP VideoCamera activity is implementing this: if (info.facing == CameraInfo.CAMERA_FACING_FRONT) { rotation = (info.orientation - mOrientation + 360) % 360; } else { // back-facing camera rotation = (info.orientation + mOrientation) % 360;

Hiding UISplitViewController overlay in portrait

荒凉一梦 提交于 2019-12-07 01:26:08
问题 In adopting the new UISplitViewController I'm trying to make a change a default behaviour that occurs when using the UISplitViewControllerDisplayModeAutomatic mode. When working in portrait I want the primary overlay to hide when the user triggers a push to the detail side. By default the overlay remains onscreen until the user taps over on the detail side. I've tried using the following with the delegate: - (BOOL)splitViewController:(UISplitViewController *)splitViewController

Detect rotation changes in iOS

馋奶兔 提交于 2019-12-06 17:46:19
问题 I am making an iOS app that needs to do a little interface rearrangement upon rotation. I am trying to detect this by implementing - (void)orientationChanged:(NSNotification *)note , but this gives me notifications for when the device is face up or face down. I want a way to just get notified when the interface changes orientations. 回答1: Since iOS 8, above methods were deprecated, and the proper way to handle and detect device rotation is: -(void) viewWillTransitionToSize:(CGSize)size