Change NavigationBar UIImagePickerController Header

I want to know how we can change the title bar of the UIImagePickerController navigation bar. I tried several ways, but could not do it.

tried the following methods

imgPicker.title = [NSString stringWithString:@"My Name"]; imgPicker.navigationItem.title = [NSString stringWithString:@"My Name"]; 

But he still gives me a default name called "Photo Albums." Can anyone tell me how to do this? ....

Thanks....

+6
iphone uiimagepickercontroller
source share
3 answers

I found a way to do this. When you install the UIImagePickerController delegate for yourself and implement the following method, it worked.

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

Found at this link http://forums.macrumors.com/showthread.php?t=533216

Thanks...

+47
source share

This should allow you to set the title (there was a typo in the previous answer):

 - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { [viewController.navigationItem setTitle:@"Choose A Photo"]; } 
+3
source share

Swift

IOS 8 || nine

  func navigationController(navigationController: UINavigationController, willShowViewController viewController: UIViewController, animated: Bool) { viewController.navigationItem.title = "video" // Change title imagePicker.navigationBar.tintColor = .whiteColor() //Text Color imagePicker.navigationBar.titleTextAttributes = [ NSForegroundColorAttributeName : UIColor.whiteColor() ] } 
+2
source share

All Articles