更改UIImagePickerController的NavigationBar标题 [英] Changing NavigationBar Title of UIImagePickerController

查看:100
本文介绍了更改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?....

谢谢....

推荐答案

<我发现了这样做的方法。当您将UIImagePickerController委托设置为self并实现以下方法时,它可以工作。

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:@""];
}

通过此链接找到它 http://forums.macrumors.com/showthread.php?t=533216

谢谢......

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

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