我有一个ImageView,我想从相机/画廊中选择图像以在ImageView上保留所选图像。但是,在选择画廊时,我的应用程序在iOS 11.2.6中崩溃,并带有给定错误:
由于未被发现的例外,终止应用程序 " nsinternalinconsistencyException",原因:'仅RGBA或白色 在这种情况下,空间得到了支持。'
但是,它对iOS版本少于11的工作正常。我在info.plist中添加了所有必需的东西。仍然对iOS 11不起作用。
请在此帮助我。
更新:我的代码
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:@"Choose From" preferredStyle:UIAlertControllerStyleActionSheet];
[actionSheet addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
// Cancel button tappped.
[self dismissViewControllerAnimated:YES completion:^{
}];
}]];
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Gallery" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
UIImagePickerController *imgpicker = [[UIImagePickerController alloc] init];
imgpicker.allowsEditing = YES;
imgpicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imgpicker.delegate=(id)self;
[self presentViewController:imgpicker animated:YES completion:nil];
}]];
[self presentViewController:actionSheet animated:YES completion:nil];
我正在为另一个项目使用相同的代码,因此它适用于另一个项目。但是对于这个项目,它正在崩溃。
这仅仅是因为uitabbar删除了塔巴尔的背景图像。
它对我来说很好。