Install UIBarStyle UIImagePickerController

I would like to set the UIImagePickerController line UIImagePickerController as follows, but the panel is still UIBarStyleBlackTranslucent . Is it possible to set the UIImagePickerController panel UIImagePickerController ? Thanks in advance!

 UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; imagePicker.navigationBar.barStyle = UIBarStyleBlack; 

Change 1

I can set the hue color with:

 imagePicker.navigationBar.tintColor = UIColorFromRGB(0xCC6600); 
+4
source share
3 answers

Here's what worked for me (you need to check the navigationController class, not the viewController that is presented to you, and you also need to set an opaque background color)

 - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { if ([navigationController isKindOfClass:[UIImagePickerController class]]) { navigationController.navigationBar.barStyle = UIBarStyleBlack; navigationController.navigationBar.backgroundColor = [UIColor blackColor]; } } 
+6
source
 imagePicker.navigationBar.tintColor=[UIColor blackColor]; 
+1
source

You can make changes by implementing the UINavigationControllerDelegate navigationController:willShowViewController: method, for example:

 - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { if([viewController isKindOfClass:[UIImagePickerController class]]) navigationController.navigationBar.barStyle = UIBarStyleBlack; } 
0
source

All Articles