modalviewcontroller

How to inform the parent viewcontroller about the changed screen orientation in the modal view controller?

无人久伴 提交于 2019-12-02 05:09:38
问题 I am presenting a modal view controller above a UISplitViewController while being in Portrait mode. Now I rotate the iPad to the Landscape mode and dismiss the modal view controller. It seems that UISplitViewController didn't receive the notification about the changed orientation: The 1st view of the split view controller is hidden, and the view of the 2nd is not occupying the whole screen size. If I rotate again back and forth, the split view controller is displayed normally again. Moreover,

How to inform the parent viewcontroller about the changed screen orientation in the modal view controller?

心不动则不痛 提交于 2019-12-02 02:22:36
I am presenting a modal view controller above a UISplitViewController while being in Portrait mode. Now I rotate the iPad to the Landscape mode and dismiss the modal view controller. It seems that UISplitViewController didn't receive the notification about the changed orientation: The 1st view of the split view controller is hidden, and the view of the 2nd is not occupying the whole screen size. If I rotate again back and forth, the split view controller is displayed normally again. Moreover, the problem occurs only with the iOS Simulator 5.0 (or the device running iOS5) but not with the 4.3.

ViewDidAppear not called when the modal view is dismissed

跟風遠走 提交于 2019-12-01 15:54:49
First, I create a MainViewController. Then in MainViewController, I do [self presentViewController:modalViewController animated:YES completion:nil]; modalViewController.modalPresentationStyle = UIModalPresentationFormSheet; When I dismiss the modalViewController, On iPhones(except iPhone 6+), viewDidAppear of MainViewController is called. On iPads and iPhone 6+, viewDidAppear of MainViewController is not called. The logic is to called a function when the modalViewController is dismissed. How can I know when the modalViewController is dismissed. You can use a delegate to call your function in

ViewDidAppear not called when the modal view is dismissed

て烟熏妆下的殇ゞ 提交于 2019-12-01 15:34:32
问题 First, I create a MainViewController. Then in MainViewController, I do [self presentViewController:modalViewController animated:YES completion:nil]; modalViewController.modalPresentationStyle = UIModalPresentationFormSheet; When I dismiss the modalViewController, On iPhones(except iPhone 6+), viewDidAppear of MainViewController is called. On iPads and iPhone 6+, viewDidAppear of MainViewController is not called. The logic is to called a function when the modalViewController is dismissed. How

How can I keep the keyboard present even when presenting a modal view controller?

老子叫甜甜 提交于 2019-12-01 13:12:27
I've got a modal view controller that is presented and a UITextView becomes the first responder and the keyboard is shown. Once this screen is loaded, the user can categorize their input before submitting it. This happens by way of another modal view controller that is presented on top. When this second one is presented, the keyboard is dismissed, the user chooses, and then reappears when the initial UITextView becomes first responder again. How can I present the second modal view controller without ever dismissing the keyboard? EDIT: I've implemented part of the UITextViewDelegate, and I'm

Stop a modal UIViewController from rotating

自作多情 提交于 2019-12-01 09:21:35
The modal UIViewController 's parent auto-rotates, but when the modal VC is up I only want it to appear in portrait and not be rotatable. I have tried simply returning NO from shouldAutorotate ... in the modal VC, but no joy. Supporting iOS 5+. Any help greatly appreciated. Basically, if you presenting Modal Controller on Any Container Controllers (i.e. UINavigationController) it have autorotation method return YES by default. So you have to make subclass for your UINavigation Controller and Deprecate Autorotation there. For iOS 5 use method: - (BOOL)shouldAutorotateToInterfaceOrientation:

Two ModalViewController

巧了我就是萌 提交于 2019-12-01 08:50:19
I have a navigationController from where I launch a ModalViewController. In this ModalViewController I will display the MailComposer which itself another ModalViewController. Now if the user hits the send button the MailComposerView should be dismissed as well the other ModalViewController. For that I call a delegate method in the mailComposerController. Now only the MailComposerView will be dismissed but no the the other ModalViewController and I get following error message attempt to dismiss modal view controller whose view does not currently appear. self = <UINavigationController: 0x724d500

Instantiating Modal view controller freezes the app - Probable issue with Xcode 7

孤街浪徒 提交于 2019-12-01 06:29:42
I am presenting a view controller modally in iOS app. The issue is that there is no crash and the app freezes as soon as presentViewController:animated is called. The stats show the CPU usage to be 100% and the usage doesn't go down even after manually closing the app. UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; CustomModalViewController *vvc = [sb instantiateViewControllerWithIdentifier:@"CustomModalViewController"]; if(!vvc){ NSLog(@"ERROR!!! vvc is null"); } NSLog(@"instantiate modal view controller"); vvc.providesPresentationContextTransitionStyle = YES; vvc

Call presentModalViewController from NSObject class

你说的曾经没有我的故事 提交于 2019-12-01 06:19:15
In my subclass of NSObject I would like to call something like [[self navController] presentModalViewController:myView animated:YES]; But none of my tries were successful. How can I call a modal view if I'm not in a subclass of UIViewController ? Solution: #import "myProjectNameAppDelegate.h" // ... MyViewController *myView = [[MyViewController alloc] init]; myProjectNameAppDelegate *appDelegate = (myProjectNameAppDelegate *)[[UIApplication sharedApplication] delegate]; [[appDelegate navController] presentModalViewController:myView animated:YES]; I don't see a way to display a modal view

Instantiating Modal view controller freezes the app - Probable issue with Xcode 7

三世轮回 提交于 2019-12-01 05:19:37
问题 I am presenting a view controller modally in iOS app. The issue is that there is no crash and the app freezes as soon as presentViewController:animated is called. The stats show the CPU usage to be 100% and the usage doesn't go down even after manually closing the app. UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; CustomModalViewController *vvc = [sb instantiateViewControllerWithIdentifier:@"CustomModalViewController"]; if(!vvc){ NSLog(@"ERROR!!! vvc is null"); }