presentViewController显示方式的窗口,没有导航栏的解决方法

来源:互联网 发布:海尔软件下载 编辑:程序博客网 时间:2024/05/21 18:45

ViewController *Controller = [[ViewController alloc] init];[self presentViewController:Controller animated:YES completion:nil];

怎么看怎么觉得代码没啥问题,搜索了半天发现应该采用如下方式,对Controller进行转换

ViewController *Controller = [[ViewController alloc] init];UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:Controller];[self presentViewController:nav animated:YES completion:nil];


这样就OK啦


1 0
原创粉丝点击