Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIDocumentMenuViewController more button

I have the code below in my app and when I click the "More" button, the dropbox option is displayed and disappear quickly, not allowing to enable.

UIDocumentMenuViewController *picker = [[UIDocumentMenuViewController alloc]
                                            initWithDocumentTypes:@[(NSString *)kUTTypeImage]
                                            inMode:UIDocumentPickerModeImport];
    [picker addOptionWithTitle:@"Rolo de Câmera" image:[UIImage imageNamed:@"ic_photo_library"] order:0 handler:^{

    }];
    [picker addOptionWithTitle:@"Tirar Foto" image:[UIImage imageNamed:@"ic_photo_camera"] order:0 handler:^{

    }];
    picker.delegate = self;
    [self presentViewController:picker animated:YES completion:nil];

Result:

DocumentPicker Bug

Any suggestion?

like image 352
Auguimar Júnior Avatar asked May 31 '26 13:05

Auguimar Júnior


1 Answers

The problem is with isTranslucent property of UINavigationBar. I faced the same problem and I solved by removing this line in my didFinishLaunchingWithOptions method

UINavigationBar.appearance().isTranslucent = false
like image 72
Giorgio Avatar answered Jun 02 '26 04:06

Giorgio