orientation

UISplitViewController - Show popover for master view on viewDidLoad

牧云@^-^@ 提交于 2019-12-11 03:40:18
问题 Is it possible to show master view in popover on viewDidLoad (when the view is in portrait orientation)? 回答1: Solution 1: [self.popoverButtonItem.target performSelector: self.popoverButtonItem.action withObject: self.popoverButtonItem]; Solution 2: [self.popoverController presentPopoverFromBarButtonItem:toolbarButtonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO]; But the trick is when to use these statements. I had to use a flag for this purpose, in order to show the

Disable rotation for one UITabbar item

房东的猫 提交于 2019-12-11 03:20:46
问题 I have a uitabbarcontroller with 4 tab bar items and each tab bar item has a uinavigationcontroller. I needed to lock the orientation of one uitabbar item only to Portrait. So i implemented the following code: Created a custom tab bar controller and added the following code in it: MainTabBarController.m -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // You do not need this method if you are not supporting earlier iOS Versions return [self

Comparison: TYPE_ROTATION_VECTOR with Complemenary Filter

冷暖自知 提交于 2019-12-11 02:48:35
问题 I have been working on Orientation estimation and I need to estimate correct heading when I am walking in straight line. After facing some roadblocks, I started from basics again. I have implemented a Complementary Filter from here, which uses Gravity vector obtained from Android (not Raw Acceleration), Raw Gyro data and Raw Magnetometer data. I am also applying a low pass filter on Gyro and Magnetometer data and use it as input. The output of the Complementary filter is Euler angles and I am

statusbar frame sticks to portrait orientation and occludes window.view

雨燕双飞 提交于 2019-12-11 02:42:57
问题 I'm working on a iPad application that should support all orientations. I am not using nibs. I have a UIWindow that lays out four views: Two of which take up full width, but not much height. The other two take up the bulk of the height, and share the same origin.x. They do not overlap. I designate one view as the main window's subview, and subview the rest to window.view. The issue: after rotation, it appears as thought the status bar's frame sticks to its original position (top of portrait

Not working Orientation Notifications in VIewController under modal, with iOS5

自古美人都是妖i 提交于 2019-12-11 01:08:20
问题 Excuse my English.. :) In my viewController (A) there is a orientation notifier like this: - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { UIDeviceOrientation newOrientation = [[UIDevice currentDevice] orientation]; if (newOrientation == UIDeviceOrientationUnknown || newOrientation == UIDeviceOrientationFaceUp || newOrientation == UIDeviceOrientationFaceDown) { UIInterfaceOrientation mainOrientation = [[UIApplication sharedApplication]

Device orientation sensor to CSS transform

折月煮酒 提交于 2019-12-10 22:41:45
问题 I've created the following widget (see demo here) to mimic the sensors tab on the chrome developer tab: My code listens to the orientation event of the device and tries to convert the values to fit the css transform scale, like so: let phone = document.querySelector(".phone"); window.addEventListener('deviceorientation', (event) => { phone.style.transform = "rotateY(" + ( event.alpha) + "deg) " + "rotateX(" + (90 - event.beta) + "deg) " + "rotateZ(" + (event.gamma ) + "deg)"; }) However, if I

How to allow a particular view controller to support for both landscape and portrait orientation

给你一囗甜甜゛ 提交于 2019-12-10 22:12:21
问题 My application is navigation based application which is supporting iOS 6. Except a view controller all others will support only portrait mode. Particular view controller alone has to support both landscape and portrait orientations. I searched lot there are tons of questions for this but none of the answer is suitable for me. If some one knows, kindly guide me I set the orientation as Portait in Project -> Targets -> Summary -> Supported orientation 回答1: First you should use methods for the

How to detect the orientation of a PDF document in iPhone SDK

浪子不回头ぞ 提交于 2019-12-10 20:13:50
问题 I am currently working for a simple PDF reader using CGPDFDocumnentRef. It is all fine when I try to render a Portrait PDF document. But when I try to render one in Landscape, it shows a rotated PDF document. Of course when I view that landscape PDF file in the web browser of a pdf reader, it is a landscape one. Is there any method in iPhone SDK that can detect the Orientation of a pdf document? Any help would be appreciated. Regards, Xeron0719 回答1: You may try to get the page size of your

iPhone SDK: Locking the orientation

自古美人都是妖i 提交于 2019-12-10 18:55:16
问题 I've seen it on a previous app (forgetting the app name), where you could lock the current orientation of the screen. Is there an easy way for this to be done, for example, simply using a button. 回答1: Just add an ivar to your app delegate that can be set by pressing the locking button. Then in all of your view controllers you can just check the ivar in the app delegate and respond to the - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation message

Android Camera orientation, phone gives false data?

可紊 提交于 2019-12-10 17:49:16
问题 I'm using the code from Android camera docs: public static void setCameraDisplayOrientation(Activity activity, int cameraId, android.hardware.Camera camera) { android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo(); android.hardware.Camera.getCameraInfo(cameraId, info); int rotation = activity.getWindowManager().getDefaultDisplay() .getRotation(); int degrees = 0; switch (rotation) { case Surface.ROTATION_0: degrees = 0; break; case Surface.ROTATION_90: degrees = 90