modal-view

Present and dismiss modal view controller

萝らか妹 提交于 2019-11-26 21:49:53
Can anyone give me the example code that I can use to first present a modal view controller, then dismiss it? This is what I have been trying: NSLog(@"%@", blue.modalViewController); [blue presentModalViewController:red animated:YES]; NSLog(@"%@", blue.modalViewController); [blue dismissModalViewControllerAnimated:YES]; NSLog(@"%@", blue.modalViewController); This code is in viewDidLoad ("blue" and "red" are both subclasses of UIViewController). I expect that I will show the red view and then immediately hide it, with some animation. However this piece of code only presents the modal view and

Iphone SDK dismissing Modal ViewControllers on ipad by clicking outside of it

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 15:48:09
I want to dismiss a FormSheetPresentation modal view controller when the user taps outside the modal view...I have seen a bunch of apps doing this (ebay on ipad for example) but i cant figure out how since the underneath views are disabled from touches when modal views are displayed like this (are they presenting it as a popover perhaps?)...anyone have any suggestions? Danilo Campos I'm a year late, but this is pretty straightforward to do. Have your modal view controller attach a gesture recognizer to the view's window: UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc]

Present and dismiss modal view controller

江枫思渺然 提交于 2019-11-26 08:03:48
问题 Can anyone give me the example code that I can use to first present a modal view controller, then dismiss it? This is what I have been trying: NSLog(@\"%@\", blue.modalViewController); [blue presentModalViewController:red animated:YES]; NSLog(@\"%@\", blue.modalViewController); [blue dismissModalViewControllerAnimated:YES]; NSLog(@\"%@\", blue.modalViewController); This code is in viewDidLoad (\"blue\" and \"red\" are both subclasses of UIViewController). I expect that I will show the red

Iphone SDK dismissing Modal ViewControllers on ipad by clicking outside of it

拟墨画扇 提交于 2019-11-26 05:59:42
问题 I want to dismiss a FormSheetPresentation modal view controller when the user taps outside the modal view...I have seen a bunch of apps doing this (ebay on ipad for example) but i cant figure out how since the underneath views are disabled from touches when modal views are displayed like this (are they presenting it as a popover perhaps?)...anyone have any suggestions? 回答1: I'm a year late, but this is pretty straightforward to do. Have your modal view controller attach a gesture recognizer