uiinterfaceorientation

Quick 180 rotation of iOS Device results in the camera viewing upside-down

扶醉桌前 提交于 2019-12-03 11:39:38
I've implemented the code below to change the orientation of an AVCaptureVideoSession based upon the UIInterfaceOrientation : - (AVCaptureVideoOrientation)interfaceOrientationToVideoOrientation:(UIInterfaceOrientation)orientation { switch (orientation) { case UIInterfaceOrientationPortrait: return AVCaptureVideoOrientationPortrait; case UIInterfaceOrientationPortraitUpsideDown: return AVCaptureVideoOrientationPortraitUpsideDown; case UIInterfaceOrientationLandscapeLeft: return AVCaptureVideoOrientationLandscapeLeft; case UIInterfaceOrientationLandscapeRight: return

How do I rotate custom splash screen on iOS?

落花浮王杯 提交于 2019-12-03 10:05:23
问题 My splash screen is working, but my app works on landscape mode, and the splash screen shows in the default portrait mode. How can I start the app so that the splash screen rotates between landscape modes like my app? I'm using the following code: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Overriden to allow any orientation. if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation ==

Determining the Orientation of the screen rather than the orientation of the device

白昼怎懂夜的黑 提交于 2019-12-03 09:50:50
The [[UIDevice currentDevice] orientation] method returns a number of orientations beyond the portrait and landscape orientation. I am well aware of checking to see if the orientation returned is "valid", unfortunately if the orientation returned is NOT "valid" when my app requires a specific orientation to determine which methods to run, I have no way of knowing which method is appropriate. I have attempted a number of solutions to this, but for now the only thing I have been able to work out is to check to see if the orientation is LandscapeLeft or LandscapeRight and if it isn't I assume the

A view controller is in landscape mode, but I'm getting the frame from portrait mode?

北战南征 提交于 2019-12-03 08:31:42
I have a settings view controller with a table view. The table view is supposed to set its frame to be the frame of the view controller. My app only supports landscape mode, so that's the orientation I'm always in. However, when the settings view controller loads, the table view has the portrait mode frame of the view controller, even though it's in landscape (360 by 480 when it should be 480 by 360). Additionally, when I checked to see if the device thought it was in portrait mode, it returned true. What is causing the problem and how can I fix it? when you call [UIView init] it will default

Disabling auto rotation for a UIView

隐身守侯 提交于 2019-12-03 01:29:11
My application is composed of a toolbar and an AVCaptureVideoPreviewLayer in a background UIView. I'd like to see that toolbar rotate regarding the device orientation, so in my main ViewController, I implemented the function : - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); } This works fine, but when the interface orientation is changed, I see that the

fixed orientation for some view controllers

依然范特西╮ 提交于 2019-12-02 21:33:28
问题 In my app i've both tabbar and navigationBar. rootview controller tabbar and tabbar has 4 navigation controller. I want to make some viewcontrollers to be portrait only. It may be a common question but I've tried enough but I could not solve this. How to make portrait orientation for some view Controller? 回答1: I've solved this problem and answering so that if someone face same problem they can get a help. shouldAutorotate, supportedInterfaceOrientations,

Change UIInterfaceOrientation for only one UIViewController in app

纵饮孤独 提交于 2019-12-02 12:38:16
问题 I have an iPhone app with structure like "Navigation controller with table -> next view controller with table -> QLPreviewController". By tap in cell of table in first view controller(with navigation controller) appears new view controller with another table, by tap in cell of it shows QLPreviewController. For example: In first table there are Groups, in second table - Documents of selected Group, and QLPreviewController for previewing selected Document. Every ViewController in my app must to

Issue with device orientation and UIView during startup

廉价感情. 提交于 2019-12-02 10:18:57
I'm working on a project in which when the user press a button a video will be played, I have to program this app for all orientations. I have added images as background for buttons given those buttons position based on the size of the superview like this: button1.frame = CGRectMake(0.15 * (self.view.frame.size.width),0.15 * (self.view.frame.size.height), 0.2 * (self.view.frame.size.width), 0.2 * (self.view.frame.size.height)); When I start the app in portrait it's view is fine and also when I rotate it works fine : But if I start my app in landscape it shows a view like this: I'v used a lot

why is my view still presented in landscape?

筅森魡賤 提交于 2019-12-02 09:48:49
my view is controlled by a navigation controller, so I set the supported orientations in to the navigation controller to explicitly portrait & portraitUpSideDown and this works, however if the previous view was in landscape when the view was called upon, it will present itself in landscape and stay in landscape until the device is rotated.. How do I prevent this? Here is my code: class EditProfileViewController: UIViewController, UINavigationControllerDelegate override func viewDidLoad() { super.viewDidLoad() navigationController?.delegate = self } func

fixed orientation for some view controllers

家住魔仙堡 提交于 2019-12-02 09:45:02
In my app i've both tabbar and navigationBar. rootview controller tabbar and tabbar has 4 navigation controller. I want to make some viewcontrollers to be portrait only. It may be a common question but I've tried enough but I could not solve this. How to make portrait orientation for some view Controller? I've solved this problem and answering so that if someone face same problem they can get a help. shouldAutorotate, supportedInterfaceOrientations, preferredInterfaceOrientationForPresentation The above methods don't get called of a viewcontroller if they are inside any tabbarcontroller of