如何在UIImagePickerController中给出Title?

时间:2015-05-18 04:55:19

标签: ios iphone uiimagepickercontroller

I want to title in image crop view  i want to give title in <code>UIImagePickerController</code> like following image screen shot.

我想在UIImagePickerController中给出标题,如图片截图所示

3 个答案:

答案 0 :(得分:1)

UIImagePickerController委托设置为self并实施UINavigationControllerDelegate的以下方法:

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

答案 1 :(得分:1)

您尝试此代码:

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
UINavigationItem *ipcNavBarTopItem;

// add done button to right side of nav bar
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Photos"
                                                               style:UIBarButtonItemStylePlain 
                                                              target:self 
                                                              action:@selector(saveImages:)];

UINavigationBar *bar = navigationController.navigationBar;
[bar setHidden:NO];
ipcNavBarTopItem = bar.topItem;
ipcNavBarTopItem.title = @"Photos";
ipcNavBarTopItem.rightBarButtonItem = doneButton;
}

答案 2 :(得分:0)

您需要在Swift中实现QAbstractListModel的委托方法:

UINavigationController