我想设置两个按钮的标题,在imagepickercontroller中,我已经在下面提供了我的代码。请告诉我任何想法或链接。
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if ([settingsPopoverController isEqual:button])
{
UINavigationItem *ipcNavBarTopItem;
UINavigationBar *bar = navigationController.navigationBar;
[bar setHidden:NO];
ipcNavBarTopItem = bar.topItem;
ipcNavBarTopItem.title = @"Front Cover";
}
UINavigationItem *ipcNavBarTopItem;
UINavigationBar *bar = navigationController.navigationBar;
[bar setHidden:NO];
ipcNavBarTopItem = bar.topItem;
ipcNavBarTopItem.title = @"Back Cover";
}
答案 0 :(得分:2)
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if ([settingsPopoverController isEqual:button])
{
UINavigationItem *ipcNavBarTopItem;
UINavigationBar *bar = navigationController.navigationBar;
[bar setHidden:NO];
ipcNavBarTopItem = bar.topItem;
ipcNavBarTopItem.title = @"Front Cover";
return;
}
UINavigationItem *ipcNavBarTopItem;
UINavigationBar *bar = navigationController.navigationBar;
[bar setHidden:NO];
ipcNavBarTopItem = bar.topItem;
ipcNavBarTopItem.title = @"Back Cover";
}