The Cancel button is miss?! How can I fix this? Thank you very much.
if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypePhotoLibrary])
{
if(buttonIndex == 1)
{
self.ctr = [[UIImagePickerController alloc] init];
self.ctr.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.ctr.delegate = self;
self.ctr.allowsEditing = YES;
[self presentModalViewController:self.ctr animated:YES];
}
}
Looks like apple made some mistake with it (iOS 10, Xcode 8) because just changing tint color of UIImagePickerController could not be done, cause, before controller isn't have
topItem
property, ornavigationController
property. So have done the changes inUIImagePickerController extension
. But I checkednavigationController
andtopItem
in those overrided methods:viewDidLoad
,viewWillAppear
,viewDidAppear
. but it still wasnil
. So i decide to check it inviewWillLayoutSubviews
, and voila! It's wasn't nil, so we can set bar tint color of exact rightBarButtomItem here!Here is example:
And don't forget to call
super.viewWillLayoutSubviews
, it's very important ;-) EDIT: But it still has problems when return to the albums screen..Change the tintColor
If that doesn't work run through your view controllers to see if there isn't a place where you changed the appearance of the navigation bar and reset the change.
Just change the UIImagePickerController navigationBar.tintColor, it should be OK.