2

我在设备上运行我的应用程序时遇到以下错误(我没有在模拟器中运行它):

CGImageCreateWithImageProvider`:无效的图像尺寸:180 x 180。

- (IBAction)choosePic:(id)sender {
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
        self.imageOne = [[UIImagePickerController alloc] init];
        self.imageOne.sourceType = UIImagePickerControllerSourceTypeCamera;
        self.imageOne.delegate = self;
    }
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
        self.imageOne = [[UIImagePickerController alloc] init];
        self.imageOne.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        self.imageOne.delegate = self;
    }
    [self presentViewController:self.imageOne animated:YES completion:nil];
}
4

1 回答 1

0

根据答案

此错误可能是较低 iOS 版本的设备。由于某些 iOS 版本不支持调整图像大小。也可能是JPG形象的问题。尝试使用PNG图像。

于 2013-06-28T12:51:04.767 回答