screen-orientation

Android SensorManager strange how to remapCoordinateSystem

╄→尐↘猪︶ㄣ 提交于 2019-11-28 16:07:24
API Demos -> Graphics -> Compass It works properly only, until you don't change the device natural orientation. In most phones is the portrait and most 10 inch tablets are the landscape. If you change than need to rotate this with 90 degree. I would like to see a 3D fix for that system. 100% sure need to use remapCoordinateSystem() method. I would like to see how ( code ) if I could see an explanation with how is calculated those axes mapping ( theoretical math ) it would be nice. I have tryed to understand, but I forgot all linear algebra. Here it says why must we use, but doesn't telling how

Android : Save application state on screen orientation change

你离开我真会死。 提交于 2019-11-28 11:40:51
I have seen the following links before posting this question http://www.devx.com/wireless/Article/40792/1954 Saving Android Activity state using Save Instance State http://www.gitshah.com/2011/03/how-to-handle-screen-orientation_28.html How to save state during orientation change in Android if the state is made of my classes? I am not getting how should i override the following function : @Override public Object onRetainNonConfigurationInstance() { return someExpensiveObject; } In my application i have layout with one editext visible and other editext get visible when the data of first editext

Webview resizes automatically to portrait and landscape view in iphone

旧城冷巷雨未停 提交于 2019-11-28 10:21:38
I am new to iphone development.In my app, i want to display the web view in device with c portrait Orientation.It should also support landscape orientation. I used the below method but there is no expected output. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); } please guide me.Please help me out.Thanks I think you have set the fixed frame for webview.That

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

邮差的信 提交于 2019-11-28 09:13:44
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). What is the best method for accomplishing: The device's current orientation when the extension is first

How is application orientation (landscape or portrait) locked?

廉价感情. 提交于 2019-11-28 07:39:28
I have tried to freeze orientation using: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); Although the display stays in portrait orientation, the activity is still recreated. Any ideas how to solve this? How can the orientation of the application be locked such that the activity is not recreated on orientation change? First, don't use setRequestedOrientation() if you can avoid it. Use the android:screenOrientation attribute in your <activity> manifest element instead. Second, you will also need android:configChanges="keyboardHidden|orientation" in your <activity> manifest

Spinner drop-down list and screen orientation change problem

喜欢而已 提交于 2019-11-28 04:54:44
问题 I have a problem with a spinner drop down list and changing orientations. In my activity, I display a dialog in which I have two spinners. When the dialog is shown to the user and the user changes the screen orientation, everything is OK-- in my onPause, I just simply dismiss the dialog. If the user taps on the spinner, a drop-down list is shown to user before changing orientation. But I have encountered an error when the user doesn't select anything from the drop-down list, and just leaves

i want to make my application only in landscape in android

天涯浪子 提交于 2019-11-28 04:38:32
I want to make my app work only in landscape mode but can't make it work. I have given screenOrientation = "landscape" even though the first page will be in landscape mode and other activity will be in portrait. XML FILE <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Main" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent

Problems when handling orientation changes

放肆的年华 提交于 2019-11-28 04:21:38
问题 I need to handle orientation changes in my Android application. For this purpose I decided to use OrientationEventListener convenience class. But his callback method is given somewhat strange behavior. My application starts in the portrait mode and then eventually switches to the lanscape one. I have some custom code executing in the callback onOrientationChanged method that provides some additional UI handling logic - it has a few calls to findViewById . What is strange is that when

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

。_饼干妹妹 提交于 2019-11-28 04:18:51
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! You also want to add the maximum scale <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> UPDATED I agree

How do I set the monitor orientation in Windows 7?

老子叫甜甜 提交于 2019-11-28 00:07:37
I want to write some fun code to flip the orientation upside down on Windows 7. See screen shot of the option I want to control. Here is the code I have: class Program { public const long WM_PAINT=0x0F; public const long WM_DISPLAYCHANGE=0x7E; [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)] public struct DEVMODE // taken from Win API { ... public System.Windows.Forms.ScreenOrientation dmDisplayOrientation; } [DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern bool EnumDisplaySettings(string lpszDeviceName, int iModeNum, ref DEVMODE lpDevMode); [DllImport("user32