如何给UIImagePickerController中的标题?

我想在图像裁剪视图中标题我想给像<code> UIImagePickerController </ code>中的标题像下面的图像屏幕截图。

我想给图像屏幕截图中显示的UIImagePickerController标题

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

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

你试试这个代码:

 - (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; } 

你需要在Swift中实现UINavigationController的委托方法:

 func navigationController(navigationController: UINavigationController, willShowViewController viewController: UIViewController, animated: Bool) { viewController.navigationItem.title = "Some title" }