Search code examples
uiimagepickercontrollerios7

iOS7 UIImagePickerController cancel button disappear


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

    }

enter image description here


Solution

  • Just change the UIImagePickerController navigationBar.tintColor, it should be OK.

    self.ctr.navigationBar.tintColor = [UIColor redColor];//Cancel button text color
    [self.ctr.navigationBar setTitleTextAttributes:@{UITextAttributeTextColor: [UIColor blackColor]}];// title color
    

    enter image description here