I\'m using UIImagePickerController inside a UIPopoverController to select image just from photo albums. When I launch app on device running iOS 8, the Cancel button on the top r
@JozoL Write the Below Code this works
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
UINavigationItem *pickerNavBarTopItem;
// add done button to right side of nav bar
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Cancel"
style:UIBarButtonItemStylePlain
target:self
action:@selector(doSomething)];
UINavigationBar *bar = navigationController.navigationBar;
[bar setHidden:NO];
pickerNavBarTopItem = bar.topItem;
pickerNavBarTopItem.rightBarButtonItem = doneButton;
}
-(void)doSomething{
}
In my case, UIImagePickerController
was not showing its cancel button
. So I tried adding this line to code:
pickerController.navigationBar.barStyle = UIBarStyleDefault;
And this worked for me.Try setting color of Cancel button like this
pickerController.navigationBar.tintColor = [UIColor blackColor];
Try using this code and let me know if it helps you.
For swift2.x you can try below code, Its work for me
pickerController.navigationBar.tintColor = UIColor.blueColor()