gpt4 book ai didi

ios - 如何在 UIDocumentPickerViewController 中更新框架大小的样式

转载 作者:行者123 更新时间:2023-11-28 23:35:58 60 4
gpt4 key购买 nike

在我的应用程序中,我的 UIDocumentPickerViewController 的框架大小始终全屏,如下图和以下代码所示。但是,我发现 UIDocumentPickerViewController 有不同的帧大小,但我不知道如何获得第二张图片的效果。有谁知道如何实现这个效果吗?

https://drive.google.com/file/d/1_q_kfIIYA0d0KcT7NyPpFb6Q1vymU-lb/view?usp=sharing

- (void)btnPressDown {
NSLog(@"Press Down QQ");
[self showDocumentPickerInMode:UIDocumentPickerModeImport];
}
- (void)showDocumentPickerInMode:(UIDocumentPickerMode)mode {
NSLog(@"showDocumentPickerInMode QQ");
UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.data"] inMode:mode];
picker.delegate = self;

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

https://drive.google.com/file/d/177W-O0eJmePhLfS8ifGlw9n3jj26FDn9/view?usp=sharing

最佳答案

您需要设置演示风格。呈现样式决定了模态呈现的 View Controller 如何在屏幕上显示。 "picker.modalPresentationStyle = UIModalPresentationFormSheet;"

- (void)showDocumentPickerInMode:(UIDocumentPickerMode)mode {
UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.data"] inMode:mode];
picker.modalPresentationStyle = UIModalPresentationFormSheet;
picker.delegate = self;
[self presentViewController:picker animated:YES completion:nil];
}

就是这样:)

关于ios - 如何在 UIDocumentPickerViewController 中更新框架大小的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54901466/

60 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com