我正在使用 image_picker 包在我的 Flutter iOS 应用程序中选择照片。它工作正常,但看起来像屏幕截图。无法选择或取消它。这是我的代码:
final imagePicker = ImagePicker();
final image = await imagePicker.pickImage(source: ImageSource.gallery);
我尝试以自己的方式展示PHPickerViewController。
case "showImagePicker":
var config = PHPickerConfiguration(photoLibrary: .shared())
config.selectionLimit = 1
config.filter = PHPickerFilter.images
let phPicker = PHPickerViewController(configuration: config)
phPicker.delegate = self
self.window?.rootViewController?.present(phPicker, animated: true, completion: nil)
结果是一样的。呈现一个简单的 UIViewController 就可以了。
let phPicker = UIViewController()
phPicker.view.backgroundColor = UIColor.red
self.window?.rootViewController?.present(phPicker, animated: true, completion: nil)
现在我很困惑。
iOS 18 模拟器(Rosseta)上有一个bug