orientation

iOS best way to change the UI when orientation is changed

半世苍凉 提交于 2019-12-23 23:35:56
问题 Which is the best way to change the UI when orientation is changed? For example, use two different UIView one portrait and a landscape and show one of both if orientation is changed, or use one UIView and change the UI control sizes and positions? Any other ideas? 回答1: - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation ==

iPad launch orientation

随声附和 提交于 2019-12-23 23:16:14
问题 After reading many posts, I still haven't got a clue how to solve this problem... The first view of my app is a tableViewController. I override (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation and it always returns YES. If I hold my iPad upright under landscape orientation, it rotates right after I launch the app. However, if I put my iPad flat on the table, even though my homepage is in landscape orientation, it launches in protrait orientation. So

iOS - Force Landscape Orientation

房东的猫 提交于 2019-12-23 19:33:59
问题 I've been trying to figure this out for a while now and its possibly a duplicate but I haven't found a correct solution. So I've created a view controller and the build the xib in landscape mode. When I try to push the view controller, it displays as Portrait but I want it to show up landscape. I've added the following methods to my code: - (BOOL)shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscapeRight |

How to make Android system force LANDSCAPE for all apk?

六眼飞鱼酱① 提交于 2019-12-23 17:28:00
问题 To get this, I've made three kind of modify in android system(v4.04).They are: 1. WindowsManagerService.java, modified the getOrientationFromWindowsLocked(); 2. Activity.java, modified the onResume(); 3. PhoneWindowManager.java, modified the setInitialDisplaySize(); They all get work, but also with some side effect. So is there a better modify for this? Any suggestion will greatly appreciated. Thanks very much. 回答1: According to me you have to modified your SensorManager class in android. The

Force the iOS device to change orientation

六眼飞鱼酱① 提交于 2019-12-23 16:16:36
问题 First of all, I would like to apologize for asking the same question again which has been asked in this forum many times. But, my problem is that I've tried all the suggested solutions but still I haven't got a solution to my problem. I have a ViewControllerA in Potrait mode and ViewControllerB in landscape mode. When the device changes from potrait to landscape, i can see ViewControllerB opening in landscape mode, but when the device is rotated back to potrait mode, ViewControllerA is

UITableView portion loses interaction after device rotation

旧时模样 提交于 2019-12-23 16:16:34
问题 I have a UIViewController with a UIView subclass as a subview, and in here is a UITableView added as a subview of that UIView, as follows: UIViewController -UIView --UITableView (plucked from a UITableViewController) On an iPad, if I load the view controller in either orientation I can interact with the table view perfectly. However, if I rotate the device to a new orientation - I have code that alters the frames to make it fit the new resolution, but a small area of the table does not

How to prevent orientation change for just a layout, not the whole screen/activity

送分小仙女□ 提交于 2019-12-23 14:51:40
问题 I would need a child layout (can be any layout, like FrameLayout or RelativeLayout ) to ignore orientation change and remain always in landscape orientation. But not its parent or any other sibling layouts/views, they should change their orientation accordingly. Hence, I cannot use setRequestedOrientation() or android:screenOrientation="landscape" . Or it will lock the orientation for the whole screen or the activity. I need to lock only just this single layout. My layout XML: RelativeLayout

How to prevent orientation change for just a layout, not the whole screen/activity

狂风中的少年 提交于 2019-12-23 14:51:34
问题 I would need a child layout (can be any layout, like FrameLayout or RelativeLayout ) to ignore orientation change and remain always in landscape orientation. But not its parent or any other sibling layouts/views, they should change their orientation accordingly. Hence, I cannot use setRequestedOrientation() or android:screenOrientation="landscape" . Or it will lock the orientation for the whole screen or the activity. I need to lock only just this single layout. My layout XML: RelativeLayout

How to write orientation data to the UIImage iOS SDK

橙三吉。 提交于 2019-12-23 12:50:09
问题 I have a problem i got a UIImage from imagePicker (camera not library) but when i write it to file with [UIImageJPEGRepresentation writeToFile: atomically:] i'm loosing orientation data(all images are in landscape), i used some code with image transformation, but it take too long about 1,5 - 2 sec per image, my question is how to not loose orientation ? Maybe i can write it to EXIF data ? Thx for help. EDIT: Thx to Jonathan Cichon, now i got a image orientation with

Allow all orientations for only one view controller

十年热恋 提交于 2019-12-23 12:36:12
问题 I know this question was already asked in here, here and here. I tried all possible ways but wasn't successful. I'm trying to develop an application in Swift (iOS 8), in which only one view controller can be viewed in all orientations others in only portrait. For this, I have enabled only Portrait mode in Target->General->Device Orientation (because I want the application to operate only in portrait mode except one view controller). I have added below code to the view controller that I want