device-orientation

App Orientation in iOS9 Split View

无人久伴 提交于 2019-12-08 07:35:48
问题 I'm looking at how my app will run in Split View on an iPad Pro. I use constraints for layout, but sometimes I want to know the window orientation in order to tweak the layout by modifying a couple of constraints. Things are easy to handle if the user rotates the device (I handle the call of viewWillTransitionToSize), but the app has to know its initial orientation. Until now, I have been using the status bar orientation to determine the device orientation: UIInterfaceOrientation o = [

What is the proper way to handle image rotations for iphone/ipad?

我的梦境 提交于 2019-12-07 16:38:23
问题 I have 2 images, one in portrait mode, and the other in landscape mode. What is the best way to switch these images when a mobile device view rotation takes place? Currently I just display the portrait image. And when the device rotates to landscape mode the portrait image is simply stretched. Should I be checking within the orientation rotation handler and simply reset the image to the proper orientational image (i.e. set it manually based on the orientation)?? Thanks! 回答1: I found three

How can I properly control stage orientation on Android with AIR mobile?

微笑、不失礼 提交于 2019-12-07 11:03:57
问题 I have an AIR application that I wish to lock into landscape orientation. I never want the application to rotate to portrait mode. Adobe's solution to this problem, seemingly, would be to configure my *-app.xml file as follows: <!-- The initial aspect ratio of the app when launched (either "portrait" or "landscape"). Optional. Mobile only. Default is the natural orientation of the device --> <aspectRatio>landscape</aspectRatio> <!-- Whether the app will begin auto-orienting on launch.

Different gyroscope values in chrome mobile and safari mobile

让人想犯罪 __ 提交于 2019-12-07 05:31:54
问题 I am currently building a small panoramic photo viewer which has an option to navigate the scene with a gyroscope. I am taking the data from the deviceOrientation event and turning the euler angles into a rotation matrix, and then putting that through some transformations and eventually moving a css cube with a 3dMatrix transform. My problem is that I am getting very different data coming in from the deviceOrientation event on different browsers on different devices, and I don't understand

Add offset to DeviceOrientationControls in three.js

試著忘記壹切 提交于 2019-12-06 14:55:58
I'm trying to add an offset to the camera after deviceControls.update(); command. I used DeviceOrientationControls as shown in this first example. The offset will be the result of a drag gesture, as presents in this example. When I multiply the 2 quaternions (I have tried a x b and b x a), the final result is not correct. Here is my operation : const m1 = new THREE.Matrix4(); m1.lookAt(new THREE.Vector3(), camera.target, THREE.Object3D.DefaultUp.clone()); const quater = new THREE.Quaternion(); quater.setFromRotationMatrix(m1); const finalQuater = new THREE.Quaternion(); finalQuater

What is the proper way to handle image rotations for iphone/ipad?

孤街醉人 提交于 2019-12-06 01:51:20
I have 2 images, one in portrait mode, and the other in landscape mode. What is the best way to switch these images when a mobile device view rotation takes place? Currently I just display the portrait image. And when the device rotates to landscape mode the portrait image is simply stretched. Should I be checking within the orientation rotation handler and simply reset the image to the proper orientational image (i.e. set it manually based on the orientation)?? Thanks! Shamsudheen TK I found three ways.I think the last one is better 1: Autoresizing Example: UIImageView *myImageView=[

Testing hardware support in Javascript for device orientation events of the iPhone 3GS

懵懂的女人 提交于 2019-12-04 12:02:47
问题 I'm trying to use HTML5 deviceOrientation events in Javascript to rotate an image when the user rotate his iPhone around him. I use this code to detect when the gyroscope is moving : window.addEventListener('deviceorientation', function (e) { alpha = e.alpha; beta = e.beta; gamma = e.gamma; }, true); It really works well on iPhone 4+ and iPad 2, but there's no gyroscope on the 3GS (and older iPhones). That's why I'm testing the deviceOrientationSupport like this : if(window

In App Billing - Rapid Device Orientation - causes crash (IllegalStateException)

て烟熏妆下的殇ゞ 提交于 2019-12-04 08:50:56
I implemented In-app Billing (v3) according to Android's Implementing In-app Billing guide. All works fine, until I rotate the device, then immediately rotate it back to it's original orientation. Actually, sometimes it works, and sometimes it crashes with: java.lang.IllegalStateException: IabHelper was disposed of, so it cannot be used. Seems this is related to the asynchronous nature of IAB, though I'm not positive. Any thoughts? Ben H You're probably getting the exception because somewhere in the activity lifecycle, you called mHelper.dispose() , then tried to use that same disposed

UISplitViewController and orientation - iOS < 5.0

a 夏天 提交于 2019-12-04 03:18:05
问题 I am using a splitviewcontroller as the rootview of my application. I need to show the login and registration views as a modal view on top of the splitviewcontroller. When i try presenting login/reg view from the viewdidAppear method of splitViewController's rootview, it is not showing up. I tried presenting the login/reg view from the Appdelegate's didFinishLaunching method using the following code [self.window.rootViewController presentModalViewController:self.navController animated:NO];

Saving some data on orientation change in Android

此生再无相见时 提交于 2019-12-03 20:57:46
问题 As far as I've understood, your Android activity will be recreated for the new orientation on any orientation changes. Is there a way to store / save some of the data from the original orientation upon the orientation change? I'd like to store some Bitmaps, so I don't have to load it again on the orientation change. 回答1: Using static variables/classes is a bad approach in terms of maintainability and debugging. I have been using Activity.onRetainNonConfigurationInstance but I found out just