screen-orientation

Will $(window).resize() fire on orientation change?

我与影子孤独终老i 提交于 2019-11-27 04:18:44
问题 Im using this to run some code when a browser window is resized: $(window).resize(callback) I also need to run this code when the orientation is changed in phones and tablets. Will the above fire on this event? 回答1: Some devices/browsers do, some not. You need to decide your supported browsers and devices. If you want to be on secure side you should use the resize event and get/check the sizes inside in it; if you know your desired devices go with a simple orientation change: Easy solution: /

How is application orientation (landscape or portrait) locked?

元气小坏坏 提交于 2019-11-27 01:59:25
问题 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? 回答1: First, don't use setRequestedOrientation() if you can avoid it. Use the android:screenOrientation attribute in your <activity> manifest element instead.

How do I change screen orientation in the Android emulator?

给你一囗甜甜゛ 提交于 2019-11-26 23:20:45
How do we change emulator screen orientation to landscape or portrait? Jeff Gilfelt Ctrl + F12 is the keyboard shortcut. Neelaganda Moorthy Android Emulator Shortcuts Ctrl+F11 Switch layout orientation portrait/landscape backwards Ctrl+F12 Switch layout orientation portrait/landscape forwards 1. Main Device Keys Home Home Button F2 Left Softkey / Menu / Settings button (or Page up) Shift+f2 Right Softkey / Star button (or Page down) Esc Back Button F3 Call/ dial Button F4 Hang up / end call button F5 Search Button 2. Other Device Keys Ctrl+F5 Volume up (or + on numeric keyboard with Num Lock

Camera capture orientation on samsung devices in android

两盒软妹~` 提交于 2019-11-26 22:58:21
问题 I am creating a camera app. The image when captured is shown in the grid view. Now, the code is working completely fine on all the devices except for samsung devices. I am facing the orientation issue. When I capture an image in a portrait mode, the image rotates when displayed in the gridview. I have not kept any rotate code. Secondly, with the EXIF I achieved the proper image in the grid view but when the device orientation changes, again the image rotates in a wiered fashion. Attaching

iOS9: Alternative to UIDevice.currentDevice().setValue(…) to force orientation

六月ゝ 毕业季﹏ 提交于 2019-11-26 21:40:09
问题 It seems to me this does not work anymore in iOS9. It was the de facto way of forcing orientation changes based my SO research. It now freezes my SpriteKit game. Is it just me, and if not does anyone know of an alternative? EDIT : Portrait and UpsideDown still work. It seems only Landscape modes now cause a freeze EDIT 2: Actually I think you can go Portrait <--> UpsideDown and LandscapeLeft <--> LandscapeRight, but not in between them 回答1: Adding to Alex's answer: My experience is that Apple

How do I set the monitor orientation in Windows 7?

半世苍凉 提交于 2019-11-26 21:37:49
问题 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

How to detect when the device switch from portrait to landscape mode? [duplicate]

拜拜、爱过 提交于 2019-11-26 20:46:39
问题 This question already has an answer here: How to detect orientation change in layout in Android? 9 answers I have an app which shows fullscreen bitmaps in an activity. In order to provide fast loading time, I load them in the memory. But when the screen changes orientation, I would like to clear the cache in order to fill it again with bitmaps that fit inside the new dimensions. The only problem is that in order to do this, I need to detect when an orientation change occurs. Do anyone know

shouldAutorotateToInterfaceOrientation doesn't work

孤街醉人 提交于 2019-11-26 20:43:36
I've been writing my Universal application in portrait mode, and now after about 15 nib files, many many viewCotnrollers, I'd like to implement the shouldAutorotateToInterfaceOrientation and design some screens in Landscape mode. adding : - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } to ALL of my viewControllers, does not do the work. During Debug, i see that this method is called, but it just won't work! not in the simulator, not in the device, not in Iphone, not in Ipad! i've searched some answers in the forum, and saw some

Android: Detect Orientation Changed

被刻印的时光 ゝ 提交于 2019-11-26 20:26:44
I need to detect an orientation change in my application, but I don't want my layout to be changed from portrait to landscape. Currently I'm using the OrientationEventListener however detecting the orientation angle is not enough. I want to detect that the user changed from portrait to landscape or viceversa, and that is not just detecting if the orientation angle is 90 or 270. I want to do the same detection that the Android does to change the activity's orientantion. I tried overriding onConfigurationChanged and check if orientantion is landscape/portrait, however this still changes my

How do I get the CURRENT orientation (ActivityInfo.SCREEN_ORIENTATION_*) of an Android device?

99封情书 提交于 2019-11-26 19:45:20
I would like to find out the detailed orientation of a device, preferably one of SCREEN_ORIENTATION_LANDSCAPE , SCREEN_ORIENTATION_PORTRAIT , SCREEN_ORIENTATION_REVERSE_LANDSCAPE , SCREEN_ORIENTATION_REVERSE_PORTRAIT from ActivityInfo or equivalent. Some of the answers here on StackOverflow included getWindowManager().getDefaultDisplay().getRotation() but this doesn't really tell me whether the device is in portrait or landscape mode, only how it's turned with reference to its natural position - which in turn can be landscape or portrait in the first place. getResources().getConfiguration()