我想知道如何更改UIImagePickerController的导航栏标题。我尝试了几种方法,但无法做到。
尝试了以下方式,
imgPicker.title = [NSString stringWithString:@"My Name"];
imgPicker.navigationItem.title = [NSString stringWithString:@"My Name"];
但它仍然给我一个名为“相册”的默认标题。任何人都可以告诉我该怎么做?....
...谢谢
答案 0 :(得分:48)
我找到了办法。当您将UIImagePickerController委托设置为self并实现以下方法时,它可以工作。
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[viewController.navigationItem setTitle:@""];
}
通过此链接http://forums.macrumors.com/showthread.php?t=533216
找到它...谢谢
答案 1 :(得分:3)
这应该允许你设置标题(上一个答案有错字):
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[viewController.navigationItem setTitle:@"Choose A Photo"];
}
答案 2 :(得分:3)
<强>夫特强>
IOS 8 || 9 强>
int _tmain(int argc, _TCHAR* argv[])
{
const string filename = "C://Users/TEMP/Desktop/lab1/names.txt";
int userinput = 0;
while (true)
{
cout << "Menu: \n1) Sök del av personnamn\n2) Sök stader\n3) Exit" << endl;
cin >> userinput;
cout << endl;
if (userinput == 1)
{
namnsok;
}
else if (userinput == 2)
{
stadsok;
}
else if (userinput == 3)
{
break;
}
}
return 0;
}