modalviewcontroller

iOS — how do you control the size of a modal view controller?

妖精的绣舞 提交于 2019-11-28 03:41:27
I am presenting a modal view controller. If it matters, it is scrolling up from the bottom. How can I control what portion of the screen it occupies? EDIT: I have the following in the modal view controller. It's not helping. - (void)viewDidLoad { TestResultView *trv = [[TestResultView alloc]initWithTest: [Model m].currentTest]; self.view = trv; trv.frame = CGRectMake(0, 320, 320, 160); [trv release]; [super viewDidLoad]; } You can modify the frame of the view controller, but if you're using UIViewController's -presentModalViewController:animated: method, the view behind will be unloaded once

Dismiss two modal view controllers

不羁的心 提交于 2019-11-28 03:19:51
问题 I have a navigation controller which present one modal viewController. From inside this modal viewController I present another modal viewController. All I want is to get back from the last modal viewController to the navigationController (the root viewController).Something similar with popToRootViewController, but adapted for modalViewControllers; NavigationController -> present Modal ViewController A -> present Modal ViewController B From modal ViewCOntroller B I want to return to

Implement custom animation to present modal view from specified view on iPad

不想你离开。 提交于 2019-11-28 03:04:48
On the iPad we get much more room to work with, so presenting full screen modal views is not ideal. I know how to present modal views in the new formSheet and a close approach can be found on this question: iPad iTunes Animation The problem is that you cannot choose where the animation will come from, so it just defaults and appears from the center, I want to customize it so that it appears from a specific location. The best example I can find for this animation can be seen on the first few seconds of this video If anyone can point me on the right direction using code, tutorials or

How can I detect the dismissal of a modal view controller in the parent view controller? [duplicate]

荒凉一梦 提交于 2019-11-28 03:01:55
Possible Duplicate: Call Function in Underlying ViewController as Modal View Controller is Dismissed I've tried almost everything. Here's what I've tried: -(void)viewWillAppear:(BOOL)animated { NSLog(@"Test"); } -(void)viewDidAppear:(BOOL)animated { NSLog(@"Test"); } -(void)viewDidLoad { NSLog(@"Test"); } Why are none of these working in my parent view controller when the modal view controller is dismissed? How can I get this to work? Kiran Panesar This answer was rewritten/expanded to explain the 3 most important approaches ( @galambalazs ) 1. Blocks The simplest approach is using a callback

iPad custom size of modal view controller

我只是一个虾纸丫 提交于 2019-11-28 02:47:41
I have a couple of modal view controllers of certain size. I'm trying to avoid the use of custom views (creating full screen black translucent overlay over current view, add the modal view over that view, do the animations, etc) to present it because there is no modalPresentationStyle that fits the size of my controllers. Now I'm using UIModalPresentationPageSheet but my view is smaller in height and I have an ugly blank space Desired presentation _______________ | _______ | | | | | | | MyVC | | | | | | | ------- | --------------- Actual presentation _______________ | | | | | | MyVC | | | | |

trying to update a UILabel on a parent view controller when dismissing the modal view

百般思念 提交于 2019-11-28 01:32:41
I am trying to update a UILabel in a parent View after someone makes a change in a modal view. So, after they click "save" ... the newly entered value would change what text is displayed on the parent view controller. But, I can't seem to get that UILabel to refresh the newly entered value. Any ideas on what I can try? I've tried a few things, but being the view is already loaded, nothing is getting "refreshed". Thanks! There are many ways to do this. One way is to use NSNotificationCenter to be able to do calls between different classes. So in the parent view you will have a function

dismiss modalviewcontroller from another modalviewcontroller

蹲街弑〆低调 提交于 2019-11-27 23:21:11
I am presenting a modalviewcontroller from another modalviewcontroller. When I dismiss the second modalviewcontroller both the first and second modalviewcontroller should get dismissed. I tried to access the first modalview like [self.view.superview dismissmodalviewcontroller]; but it is showing error. What is the right way to get a ref to the first modalViewController from the second one and invoke the dismiss method from it? Its like this. A presents B. Here, A is parent of B (Here, A.modalViewController will be B and B.parentViewController will be A) And B presents C. Here, B is parent of C

How to create a UIViewController layout in storyboard and then use it in code?

天大地大妈咪最大 提交于 2019-11-27 21:18:56
问题 I have a Storyboard in my iOS 5 application. In there I have created a number of screens and it works perfectly. However there's one view controller that I create in code, not as a result of UI action but at the end of processing data. I would like to show this view controller then, as a modalViewController, but also have it designed in the storyboard editor. Is it possible? Using the nibs I did it like this: ResultsController *rc = [[ResultsController alloc] initWithNibName:@

How to HIDE the iPad keyboard from a MODAL view controller?

随声附和 提交于 2019-11-27 13:51:03
问题 I'm trying to hide the iPad keyboard from a modal view controller but it doesn't work. I have tried resignFirstResponder but that doesn't have any affect if we are in a modal view controller. I tried resignFirstResponder in a non-modal UINavigationController with the very same UIViewController and the keyboard hides correctly. Does anyone know how solve this problem? Thanks. [Update] it looks like there's something wrong with my code because the resignFirstResponder does work (I made a simple

Disable the interactive dismissal of presented view controller in iOS 13

孤街醉人 提交于 2019-11-27 13:25:08
问题 iOS 13 introduces a new design of modalPresentationStyle .pageSheet (and its sibling .formSheet ) for modally presented view controllers… …and we can dismiss these sheets by sliding the presented view controller down (interactive dismissal) . Although the new "pull-to-dismiss" feature is pretty useful, it may not always be desirable. THE QUESTION: How can we turn the interactive dismissal off? - Bear in mind we keep the presentation style the same. 回答1: Option 1: viewController