Questions tagged «modal-view»

6
显示和关闭模态视图控制器
谁能给我示例代码,我可以使用该示例代码首先呈现一个模态视图控制器,然后将其关闭?这就是我一直在尝试的: NSLog(@"%@", blue.modalViewController); [blue presentModalViewController:red animated:YES]; NSLog(@"%@", blue.modalViewController); [blue dismissModalViewControllerAnimated:YES]; NSLog(@"%@", blue.modalViewController); 这段代码在viewDidLoad中(“ blue”和“ red”都是UIViewController的子类)。我希望我将显示红色视图,然后立即将其隐藏起来,并带有一些动画。但是,这段代码仅呈现模态视图,而不会将其忽略。任何的想法?第一个日志显示“空”,而其他两个日志显示<RedViewController: 0x3d21bf0> 另一点是,如果将这段代码放在applicationDidFinishLaunching中:红色视图根本不会出现,并且所有日志都为“ null”
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.