orientation

How to get the euler-angles from the rotation vector (Sensor.TYPE_ROTATION_VECTOR)

风流意气都作罢 提交于 2019-12-18 04:55:37
问题 I rotated my android device in x direction (from -180 degree to 180 degree), see image below. And I assume only Rotation vector x value is changed. Y and z maybe have some noise, but it should be not much difference among the values. However, I receive this. Kindly see https://docs.google.com/spreadsheets/d/1ZLoSKI8XNjI1v4exaXxsuMtzP0qWTP5Uu4C3YTwnsKo/edit?usp=sharing I suspect my sensor has some problem. Any idea? Thank you very much. Jimmy 回答1: Your sensor is fine. Well, the rotation vector

UIImagePickerController Image Orientation

随声附和 提交于 2019-12-18 04:23:39
问题 Can anyone tell me how to use the UIImagePickerController (camera and album) delegates determine the image's orientation, rotate accordingly, and assign it to a UIImageView? 回答1: No, UIImagePickerController cannot do it explicitly. If you want to determine based on image's content. It is kind of hard problem. How can you determine an image's orientation without understanding the content inside of it? I can suggest you a trick that you examine the width and the length of the returned image and

Problem pushViewController from Landscape to Portrait

可紊 提交于 2019-12-18 03:45:36
问题 I am trying to go from a viewcontroller that supports landscape (while in landscape mode), to one that explicitly doesn't (and shouldn't) support landscape. I'm doing this as follows: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return (toInterfaceOrientation == UIInterfaceOrientationPortrait); } Ideally I want the new viewController that i'm pushing onto the stack to start off initially in portrait, not landscape. Strangely even with this

Detect orientation of a recorded video in android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 02:41:29
问题 I want to make my custom media player and requires orientation info of video (for detecting it is recorded from front or back camera). for jpeg images i can use ExifInterface.TAG_ORIENTATION but for video how i can find this information. I tried to grab frame from video file and convert it into jpeg but again it always provides orientation 0 in all cases. Please help me. Thanks in advance. 回答1: Api level 17 later, we can extract the orientation of video: MediaMetadataRetriever

Is it possible to prevent iPhone/iPad orientation changing in the browser?

亡梦爱人 提交于 2019-12-17 19:24:29
问题 I've seen similar questions on this issue, but they are related to native apps. I build web apps for the iPhone/iPad that run in the browser (Safari). I was wondering if there is a way to prevent orientation change in the browser, perhaps via some meta tag. I know of the viewport meta tag which allows you to specify scale and zooming capabilities, so figured maybe there is something similar for orientation. I doubt it is possible, but I thought I'd just pop a question on here to see. 回答1: It

What is the best way to detect orientation in an app extension?

假装没事ソ 提交于 2019-12-17 18:53:14
问题 What is the best way to detect a device's orientation in an application extension? I have had mixed results with solutions I've found on here: How to detect Orientation Change in Custom Keyboard Extension in iOS 8? Get device current orientation (App Extension) I have looked at size classes and UITraitCollection and found that the device inaccurately reports that it is in portrait when it is in fact in landscape (not sure if this is OS bug, or I am not querying the right APIs the right way).

calculate acceleration in reference to true north

可紊 提交于 2019-12-17 18:50:30
问题 For my App I need to calculate the acceleration of my device in reference to true north. My idea was to calculate the device orientation to magnetic north and apply the declination to it to get the orientation to true north. Then I want to calculate the acceleration of the device and reference it to the orientation, but I do not know how I should do this. I would try to get the device orientation using SensorManager.getRotationMatrix() and SensorManager.getOrientation() . Then I get the

Using orientation sensor to point towards a specific location

拥有回忆 提交于 2019-12-17 17:58:29
问题 I'm trying to implement an arrow that uses the orientation sensor in order to point towards a specific location. Google Places implements this arrow in a ListView for each place it finds. I've managed to get the azimuth, but given a location, I don't know how to proceed to calculate the angle I need. Moreover, I need to make the conversions from real north and magnetic north. Does anybody have an example of such implementation? Thanks in advance. 回答1: I solved it. float azimuth = // get

Responsive site is zoomed in when flipping between Portrait and Landscape on iPad/iPhone

回眸只為那壹抹淺笑 提交于 2019-12-17 17:35:39
问题 I've built a responsive site using Twitter Bootstrap here: http://zarin.me/cce/ The responsive design works great on iPad and iPhone, however when I flip the device from portrait to landscape, the site is zoomed in instead of adapting to the screen (pinching the screen works). What am I missing? Is this a viewport issue? Here's the only viewport code I have in my : <meta content="width=device-width, initial-scale=1.0" name="viewport"> Thanks in advance! 回答1: You also want to add the maximum

fix the orientation on page to landscape only in Jquery-mobile

青春壹個敷衍的年華 提交于 2019-12-17 16:53:39
问题 How can the orientation of a page be landscape only as i am using jquery mobile for my webapp? The page contains some tabular data which can't be shown in the portrait mode in the mobile version... Take a look of my layout.. http://jsfiddle.net/nY5ZF/1/ Can this be fixed??? 回答1: We now have responsive tables in jquerymobile 1.3.1, you could use that... http://jquerymobile.com/demos/1.3.0-beta.1/docs/tables/ As its not possible to lock the orientation in webapps unlike hybrid apps (phonegap).