UIImagePickerController's pushViewController misplace pushed view behind the navigation bar

馋奶兔 提交于 2019-12-10 12:00:45

问题


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];
}

and in SecondViewController's doing nothing special.

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?


回答1:


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



来源:https://stackoverflow.com/questions/11201042/uiimagepickercontrollers-pushviewcontroller-misplace-pushed-view-behind-the-nav

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!