UIImagePickerController

UIImagePickerController

本文介绍了更改UIImagePickerController的NavigationBar标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何更改UIImagePickerController的导航栏标题。我尝试了几种方法,但无法做到。

I want to know how we can change the navigation bar title of UIImagePickerController. I tried several ways but couldn't do it.

尝试了以下方式,

imgPicker.title = [NSString stringWithString:@"My Name"];
imgPicker.navigationItem.title = [NSString stringWithString:@"My Name"];

但它仍然给我一个名为相册的默认标题。任何人都可以告诉我如何做到了吗?....

But it still gives me the default title called "Photo Albums".Can anyone please tell me how to do it?....

谢谢....

推荐答案

I found the way to do it. When you set your UIImagePickerController delegate to self and implement the following method it worked.

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    [viewController.navigationItem setTitle:@""];
}

通过此链接找到它

谢谢......

这篇关于更改UIImagePickerController的NavigationBar标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 00:18