uiinterfaceorientation

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

Rotate only between landscapeLeft and landscapeRight

守給你的承諾、 提交于 2019-12-23 05:07:33
问题 I have vidoe playing in landscape mode. And the view only rotate between landscapeLeft and landscapeRight when the device orientation changes. That's to say there is no portrait mode when playing the movie. What's more apart from the movie view, other views are portraint mode, so the app config is portrait. How can I make the movie view only rotate in the landscape mode. Here is a part of my code. appdelegate, internal var shouldRotate = false func application(_ application: UIApplication,

UITabBarController/UINavigationController rotation issues

不打扰是莪最后的温柔 提交于 2019-12-23 01:52:44
问题 My problem is the following: I want to only allow Portrait orientation on all my ViewControllers except 1 ViewController which is supposed to allow both Portrait and landscapeLeft/Right. I have now spent almost 2 days into how to set orientation in IOS for different slides/ViewControllers. After some searching I found this thread here at stack: UITabBarController Rotation Issues in ios 6 I followed Kunani's example in that thread which I will post here to save all readers some time: Zack, I

Can a viewcontroller presented modally over current context (UIModalPresentationStyleOverCurrentContext) be rotated with device?

此生再无相见时 提交于 2019-12-23 01:19:13
问题 I have a controller which should be rotated with interface (device) orientation change. I track orientation changes, however i'm unable to rotate the view with the device orintation changes. I can animate the views inside, and switch their constraints etc, but i'd like to use Size classes for that. When i switch to UIModalPresentationStyleCurrentContext on presenting the controller it works, but messes with my navigation and tabbar, and i would like to do it this way. Can it be done this way?

Change the orientation only for specific view controllers in ios swift 2.3 and swift 3

。_饼干妹妹 提交于 2019-12-23 00:52:11
问题 I was searching that how can I change the orientation to LandScape mode only for spefic view controller when the Device Orientation is set to Portrait in the project settings . Didn't get any succesfull result. so finally I found a way to do it. this is project device orientation looks like .... In swift 2.3 add following methods override func shouldAutorotate() -> Bool { return false } override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { return

UIImagePickerController shows black bar when zooming – Is this a bug in iOS?

倖福魔咒の 提交于 2019-12-22 12:40:10
问题 Edit : It has been suggested this post is a duplicate, which is not the case as the black bars are not initially present an an affine transformation does not remedy the problem. I run this on an iPad Air 2 and target iOS 8. I have a UIImagePickerController whose showsCameraControls property is set to NO . When starting the app in landscape and then zooming in, this is what happens (all images are non-cropped): A black bar appears and can be gotten rid of by changing device orientation to

supportedInterfaceOrientationsForWindow in Swift 2.0

筅森魡賤 提交于 2019-12-22 09:37:02
问题 func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask { return UIInterfaceOrientationMask.Portrait.rawValue.hashValue | UIInterfaceOrientationMask.PortraitUpsideDown.rawValue.hashValue } That used to work in Swift 1.2 however the return line is now throwing this error: Binary operator '|' cannot be applied to two 'UIInterfaceOrientationMask' operands I am able to get to work with just 1 return value with the new

how to rotate parent view controller when child view controller orientation changes in iOS

烈酒焚心 提交于 2019-12-21 20:27:59
问题 I am displaying Child view controller on my parent view controller using childView1 *viewController = [[childView1 alloc]initWithNibName:examTFVC_NIB bundle:nil row:gesture.view.tag productID:test_productID size:testsize Duration:duration]; self.modalPresentationStyle = UIModalPresentationCurrentContext; self.view.alpha = 0.4f; viewController.view.backgroundColor = [UIColor clearColor]; viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController

Upside down orientation not working in iOS6 for UINavigation view and UITabbar view?

不打扰是莪最后的温柔 提交于 2019-12-21 07:03:47
问题 I created an app in ios 6 with navigation view.Also I have set all orientation options in the application summary and even used the -(BOOL) shouldAutoRotate and -(NSUInteger) supportedInterfaceOrientaion methods in my view controller.when I run my app orientation works fine except upside-down.What should I do to also support upside-down. I also facing the same problem when I add UITabBar controller. Please share your ideas. Thank you 回答1: Hai I have found solution for my problem Solution: For

willRotateToInterfaceOrientation not called on iOS8

╄→尐↘猪︶ㄣ 提交于 2019-12-21 04:22:20
问题 I'm using the VFR PDF viewer library in my app, where I present it thus: ReaderDocument *document = [ReaderDocument withDocumentFilePath:pdfFile password:nil]; ReaderViewController *vc = [[ReaderViewController alloc] initWithReaderDocument:document]; [self.navigationController pushViewController:vc animated:YES]; If I run on iOS7, everything works fine. If I run my app on iOS8, the willRotateToInterfaceOrientation method in ReaderViewController never gets called, so when the device is rotated