如何将现有的 UIViewController(使用presentModalViewController 呈现)添加到 UINavigationController?
当用户点击按钮时,需要推送我的详细视图的新副本。 (换句话说,pushViewController 在 UINavigationController 中以模态方式显示 pushViewController)。
启用此功能的最简单方法是什么?
如何创建模态视图控制器?只需将控制器包装到 UINavigationController 中即可
我们假设你的模态代码是这样的:
MyExampleViewController *vc = [[[MyExampleViewController alloc] initWithNibName:@"MyExample" bundle:nil] autorelease];
[self presentModalViewController:vc animated:YES];
然后把它改成这样:
MyExampleViewController *vc = [[[MyExampleViewController alloc] initWithNibName:@"MyExample" bundle:nil] autorelease];
UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:vc] autorelease];
[self presentModalViewController:navController animated:YES];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)