screen-rotation

Using onConfigurationChanged in a fragment

无人久伴 提交于 2019-11-29 17:50:41
问题 I have this code in a fragment public class TestOne extends Fragment { View view = null; @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); LayoutInflater inflater2 = (LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater2.inflate(R.layout.testone, null); Toast.makeText(getActivity(), "Rotate fragment", Toast.LENGTH_SHORT).show(); } @Override public void onCreate(Bundle savedInstanceState)

xcode - How do I keep views locked into portrait mode, but still allow one view to rotate?

依然范特西╮ 提交于 2019-11-29 15:38:12
问题 I'm having a problem with device rotation. Except for ONE view, where I show a company splash screen, I want to lock all the remaining app views into Portrait display. In the project settings the supported orientations are Portrait and LandscapeLeft. In the 'Company Splash' it works fine and the view rotation is locked into LandscapeLeft no matter how I rotate the device. On all the other views when I rotate the device to the left the view alters instead of staying in portrait display. The

iOS 9 Orientation Auto-Rotation Animation Not Working, But Always on Main Thread

喜夏-厌秋 提交于 2019-11-29 13:53:22
iOS 9.0 (13A340) Xcode 7.0 (7A220) OS X 10.10.5 (14F27) I have a situation where if I rotate the simulator or device (using iPhone 6s sim and iPhone 6+ device), the animation does not also take place. I am unsure of why this is happening. I am not doing anything unusual or crazy with any UIKit methods, and I am not calling any method not on the main thread. Additionally, other UIView animations I have added appear to work just fine. It is just the rotation that's broken. Other apps seem fine. I'm not sure what I could be doing wrong. Attempts to figure out/solve: Used this extension by

Keeping data view/layout in Android after screen rotate/activity destroyed

独自空忆成欢 提交于 2019-11-29 08:42:28
I'm a little confused about the Activity being destroyed and recreated when the user's device is rotated. I've been reading around, and I understand the rationale for doing so (it basically 'forces' the developer to make sure they haven't 'missed' anything upon rotation/language/other changes) I'm happy to respect best practice if it is seen as such, however it begs the question: How do I 'remember' the state of the game/app, so that when the screen is rotated I have something from which to re-generate what the user was looking at? From what I can see, absolutely everything is destroyed, the

Allow video on landscape with only-portrait app

不羁的心 提交于 2019-11-28 17:29:01
I have a UIWebView included in a UIViewController which is a descendant of UINavigationController. It looks like this: The app is portrait only. When I play the video I want the user to be able to rotate the device and see the video in landscape mode. I use this code to allow it: - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { id presentedViewController = [self topMostController]; NSString *className = presentedViewController ? NSStringFromClass([presentedViewController class]) : nil; if ([className isEqualToString:@

iOS 9 Orientation Auto-Rotation Animation Not Working, But Always on Main Thread

一笑奈何 提交于 2019-11-28 07:57:16
问题 iOS 9.0 (13A340) Xcode 7.0 (7A220) OS X 10.10.5 (14F27) I have a situation where if I rotate the simulator or device (using iPhone 6s sim and iPhone 6+ device), the animation does not also take place. I am unsure of why this is happening. I am not doing anything unusual or crazy with any UIKit methods, and I am not calling any method not on the main thread. Additionally, other UIView animations I have added appear to work just fine. It is just the rotation that's broken. Other apps seem fine.

UIImagePickerController camera view rotating strangely on iOS 8 (pictures)

纵饮孤独 提交于 2019-11-28 03:40:21
I have a very simple application: - All orientations are permitted with only a button on a screen - The button show a UIImagePickerController (to take a photo) - Build with Xcode 5 and SDK 7 On iOS 8 , the camera of the UIImagePickerController is appearing correctly whether I am in landscape or in portrait, but when I rotate the device, I got the camera view rotated by 90 degrees, here's a an example: I have my app in portrait I push the button that shows me the UIImagePickerController I am in the camera view and I go to landscape mode, here is what I get: The view is in landscape but the

Keeping data view/layout in Android after screen rotate/activity destroyed

纵然是瞬间 提交于 2019-11-28 02:13:15
问题 I'm a little confused about the Activity being destroyed and recreated when the user's device is rotated. I've been reading around, and I understand the rationale for doing so (it basically 'forces' the developer to make sure they haven't 'missed' anything upon rotation/language/other changes) I'm happy to respect best practice if it is seen as such, however it begs the question: How do I 'remember' the state of the game/app, so that when the screen is rotated I have something from which to

UIImagePickerController camera view rotating strangely on iOS 8 (pictures)

房东的猫 提交于 2019-11-27 19:14:55
问题 I have a very simple application: - All orientations are permitted with only a button on a screen - The button show a UIImagePickerController (to take a photo) - Build with Xcode 5 and SDK 7 On iOS 8 , the camera of the UIImagePickerController is appearing correctly whether I am in landscape or in portrait, but when I rotate the device, I got the camera view rotated by 90 degrees, here's a an example: I have my app in portrait I push the button that shows me the UIImagePickerController I am

willRotateToInterfaceOrientation not being called from presented viewcontroller

▼魔方 西西 提交于 2019-11-27 18:20:28
问题 I have uiviewcontroller on ipad with this configuration: shouldAutorotate (true) supportedInterfaceOrientations (UIInterfaceOrientationMaskAll) and inside willRotateToInterfaceOrientation i perform some trick to adjust my interface. From a child of this controller I show a QuickLookController with this -poor- code. [[[[[UIApplication sharedApplication] delegate] window] rootViewController] presentViewController:previewController animated:YES completion:nil]; But if I rotate my ipad the method