UIImagePickerController 的 pushViewController 把推视图放在导航栏后面 [英] UIImagePickerController's pushViewController misplace pushed view behind the navigation bar

查看:23
本文介绍了UIImagePickerController 的 pushViewController 把推视图放在导航栏后面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将视图控制器推入 UIImagePickerController 对象时,视图控制器的视图错位在导航栏后面.无论我选择什么作为图像选择器源.我以模态方式呈现图像选择器并在其委托中执行以下操作

When I push a view controller into UIImagePickerController object, the view controller's view is misplaced behind the navigation bar. no matter what I choose as image picker source. I present image picker modally and do the following in its delegate

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
  [[UIApplication sharedApplication] setStatusBarHidden:NO];
  [picker setNavigationBarHidden:NO];

  SecondViewController *secondVC = [[SecondViewController alloc] init];
  [picker pushViewController:secondVC animated:YES];
  [secondVC release];
}

并且在 SecondViewController 中没有做任何特别的事情.

and in SecondViewController's doing nothing special.

当我将同一个视图控制器推入 UINavigationController 的对象时,它被正确放置在导航栏下方.要使用图像选择器作为导航控制器,我还应该做什么?

When I pushed the same view controller into UINavigationController's object, it is placed correctly beneath the navigation bar. What should I do additionally to use image picker as navigation controller?

推荐答案

我应该设置图像选择器的导航栏的 translucent 在推送第二个视图控制器之前没有属性.

I should have set image picker's navigation bar's translucent property NO before push second view controller.

这篇关于UIImagePickerController 的 pushViewController 把推视图放在导航栏后面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆