orientation

How to prevent auto-rotating images on iOS on HTML with CSS/Javascript

北战南征 提交于 2019-12-13 15:15:38
问题 I am creating a photo site - I uploaded a photo of myself which is actually incorrectly oriented (the image is rotated 90 degrees counter clockwise). I have uploaded this image from my iPhone, which apparently has the image stored this way on purpose. On my site, the HTML page has rendered a JSON object that contains the URL to the photo as well as the image dimensions. I am using jQuery mobile - and onload of the page I put a link on the page, and when you click the photo it displays the

How to calculate rotation angle using Android Sensors?

不羁岁月 提交于 2019-12-13 15:07:34
问题 I am doing an Opengl appln in which i have to rotate the camera, if the android device is rotated/tilted along Z axis. I tried the SensorManager.getOrientation(R, orientVals); using the magnetic and accelerometer sensors. But the values are very much fluctuating. Gyroscope is also available in my device. Since I am animating (rotate) the camera, I need a smooth rotation values Please guide me in this regard. 回答1: See How do you calculate the rate of rotation using the accelerometer values in

Android orientation issue on samsung devies with Exif

吃可爱长大的小学妹 提交于 2019-12-13 11:02:39
问题 There is a problem when taking photo using camera on samsung devices in the landscape (http://prntscr.com/fx29hs) Problem is that Exif always return the same value for both cases 回答1: add this class public class ImageUtils { public static ImageUtils mInstant; public static ImageUtils getInstant(){ if(mInstant==null){ mInstant = new ImageUtils(); } return mInstant; } public Bitmap getCompressedBitmap(String imagePath) { float maxHeight = 1920.0f; float maxWidth = 1080.0f; Bitmap scaledBitmap =

Not able to fetch correct degree from getOrientation method

时光总嘲笑我的痴心妄想 提交于 2019-12-13 06:59:02
问题 I am trying to get the tilt angel from Android orientation. The values which i am getting from SensorManager.getOrientation(mRotationMatrix, mValuesOrientation) is not degrees.... On putting the phone on a horizontal plane it returns improper values I have tries using few methods found on net without any luck.. So far tried Math.sin(Math.toRadians(mValuesOrientation[0])); Math.toDegrees(mValuesOrientation[0]); and others Code is below public class MainActivity extends Activity { @Override

realize “back arrow” with help basefragment

拟墨画扇 提交于 2019-12-13 06:39:42
问题 I have BaseFragment public abstract class BaseFragment extends Fragment { private static String TAG = "BaseFragment"; private BaseFragmentActions baseFragmentActions; @Override public void onAttach(Context context) { super.onAttach(context); Log.i(TAG, "onAttach = "); try { baseFragmentActions = (BaseFragmentActions)(StartPageActivity)getActivity(); } catch (ClassCastException e) { throw new ClassCastException(((StartPageActivity)getActivity()).toString() + " must implement interface

Threads and device orientation

江枫思渺然 提交于 2019-12-13 06:20:35
问题 I got main Activity that on button press starts other class named Getter and that Getter class creates 1-60 000 threads (which do network stuff), so it takes some time until they all are completed. My problem is that when I rotate my device while those threads are running, my program stops working correctly. In my main Activity I have handler that every 2 seconds gets an array from Getter class and then puts those values into local array list. I tried this solution: Background task, progress

Returning from only landscape view to portrait app

社会主义新天地 提交于 2019-12-13 06:07:01
问题 I have an app that works only in portrait mode, however, there is one view that needs to support both portrait as well as landscape mode. Anytime I return from this view the rest of app mess up. The view that needs to support both orientations contains webview that is used to play live stream. Simple setting shouldAutorotateToInterfaceOrientation doesn't work. The trick with presenting modal view controller neither. The trick with removing and inserting root view doesn't work as well. I am

change layouts, but not restart activity on my Android App

隐身守侯 提交于 2019-12-13 05:47:17
问题 I want my app to go from portrait to landscape and change from layout1 to layout2 but not restart the activity. It goes from layout1 to layout2 nicely, but restarts the activity every time it switches from portrait to landscape and landscape to portrait and i want to just run the activity once then keep it there. Any help is greatly appreciated thank you. 回答1: You can achieve this by add android:configChanges="orientation" to your activity in manifest and handle the screen contents manually

How to preview images from the gallery in the correct way?

眉间皱痕 提交于 2019-12-13 05:24:16
问题 Background I know that some devices do not rotate the photos taken by the camera automatically, and therefore you have to get the orientation that camera was at, when the photo was captured (links here, here and here) . I need to show a grid of all of those photos in the correct orientation (rotate if needed), with fixed cell size and using a center crop manner The problem using center crop won't work , as it won't allow me to use ScaleType.MATRIX . I just don't get how to achieve it, and

Restrict orientation of view controller when using a static UITableView

谁说胖子不能爱 提交于 2019-12-13 05:04:01
问题 I've set up a static UITableView with iOS Designer (IB in Objective-C world). But the orientation is changed despite I want to restrict it. I've done the following: In Properties under Simulated Metrics I chose Portrait as Orientation . Than I'm implementing the following functions for my UITableViewController : public override bool ShouldAutorotate () { return false; } public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations () { return UIInterfaceOrientationMask.Portrait