modalviewcontroller

iOS8 - prevent rotation on presenting viewController

六眼飞鱼酱① 提交于 2019-11-30 06:56:09
We have a MainViewController with a tableView, and it presents a new modalViewController. The MainViewController is restricted to portrait only, and the modalViewController can rotate. The problem is in iOS8, that when the modalViewController rotates, the callback method of rotation in iOS8 in MainViewcontroller is called - - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator Thus, the UITableView is getting its data reloaded, which is a behaviour we don't want. Can we prevent this feature of iOS 8, and not rotate the

How to dismiss a modal VC with fade out animation?

时光怂恿深爱的人放手 提交于 2019-11-30 04:54:14
I am using the following code in my presenting VC to fade in the child modal VC, and this works fine: self.infoViewController.view.alpha = 0.0; [self.navigationController presentModalViewController:self.infoViewController animated:NO]; [UIView animateWithDuration:0.5 animations:^{self.infoViewController.view.alpha = 1.0;}]; However I can't get it to fade out, I have tried a few things, this is the latest I tried that doesn't work: - (IBAction)dismissAction:(id)sender { if ([[self parentViewController] respondsToSelector:@selector(dismissModalViewControllerAnimated:)]) { [[self

Partial Curl Modal Transition Style While Preserving Tool/Tab Bar

非 Y 不嫁゛ 提交于 2019-11-30 03:59:38
问题 Is there a way to present a modal view controller that doesn't cover the tab bar of a UITabBarController? Specifically I want to use the UIModalTransitionStylePartialCurl, but preserve the bottom bar, a la the iPhone maps app. 回答1: Have two view controllers In the first have the second as a subview Add your toolbar as a subview to the first and call bringSubviewToFront: Present the modal in the second 回答2: UIModalTransitionStylePartialCurl When the view controller is presented, one corner of

iOS - Semi-transparent modal view controller

一曲冷凌霜 提交于 2019-11-30 03:02:50
I want to present a view controller with a slightly transparent background modally over the current view, such that the first view is slightly visible under the modal view. I set the alpha value of the modal view controller and set the modalPresentationStyle to UIModalPresentationCurrentContext , as suggested in another post. The result is that the view background is transparent when animating up, but when view controller is in place it changes to opaque black. It goes back to being transparent while animating the dismissal. How can I get it to be transparent when active ? I have tested in iOS

Show modal view controller with custom frame in iPad

人盡茶涼 提交于 2019-11-30 01:01:56
I want to show a modal UIViewController with a custom frame in iPad, centered on top of its parent view controller. I tried using a form sheet but as far I know the frame and shadow effect can't be changed. vc.modalPresentationStyle = UIModalPresentationFormSheet; [self presentModalViewController:cv animated:YES]; I also tried using a popover but as far as I know either I can't center it or I can't hide the arrow. Is there another way to show modal view controllers? Is it possible to solve this problem by using form sheets or popovers? There is no official way to do this however you can get

Presenting a Modal View Controller hides the Navigation Bar

被刻印的时光 ゝ 提交于 2019-11-30 00:57:17
问题 I have a navigation based app with a navigation bar, but there are a few instances where instead of pushing a view controller onto the stack, I need to present the view controller modally. The problem is that when I dismiss the modal view controller, everything functions as expected except that the navigation bar is hidden and the (parent view) has been resized, which is the expected behavior according to the docs. So I figured I could simply call a built-in method to unhide the navigation

iOS5: Exception on UIWebView in modal UIViewController playing Youtube video

梦想的初衷 提交于 2019-11-30 00:38:20
问题 UPDATE: No longer occurs on iOS 6 beta 1 I am currently working on adapting an existing iOS 4 application with the new iOS 5 SDK. I found a new crash when presenting a UIWebView in a modal view controller that reads a Youtube video. Starting to read the video is fine, but when I try to set it in full screen, I get the following exception : Exception: UIViewControllerHierarchyInconsistency, child view controller:<UIViewController: 0x6aef180> should have parent view controller:

Modal view controller won't dismiss itself

佐手、 提交于 2019-11-29 23:45:13
What I'm doing: In my app, I'm presenting a modal view controller (containing app settings) using the following code: optionsViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl; [self presentModalViewController:optionsViewController animated:YES]; This transition just curls up the bottom part of the view to expose a few settings. (See the 'Maps' app for an example.) When you tap on the top half of the page, where the original view is still there but grayed out, the modal view controller is automatically dismissed (handled by the OS, I didn't code for this). - What's not

iOS : ModalView with background transparent?

孤街醉人 提交于 2019-11-29 22:17:16
I want to show a modalview on a viewController. (which has a naviguation controller). On my view i have text, and a button to show the modalview. I created a .xib which contained my modalview (it's a view with an image and a label). When i show it, with that : ShareController *controller = [[ShareController alloc] initWithNibName:@"ShareController" bundle: nil]; controller.view.backgroundColor = [UIColor clearColor]; controller.modalPresentationStyle = UIModalPresentationFormSheet; controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController:controller

How can I pop a modal view and the previous navigation controller view at once?

巧了我就是萌 提交于 2019-11-29 12:07:19
I want to pop a modal view and the previous view at the same time. For example, look at the calendars app. When I am on the Edit screen and select Delete Event , I am taken back to the calendar view. The Edit screen, which was presented modally is popped as well as the the Event screen (where the user is just viewing the calendar event). The problem I am having is that I know how to pop a modal view, but from the same UIViewController subclass ( Edit screen in this example). How can I pop a view that isn't modal? I was thinking about popping the modal view as you would normally, then posting a