簡體   English   中英

帶allowEditing的UIImagePickerController不允許平移裁剪

[英]UIImagePickerController with allowsEditing doesn't allow panning to crop

我在這里看到了這個問題: UIImagePicker允許編輯卡在中心

似乎有人之前有這個問題,但沒有明確的解決方案。

復制步驟:

  1. 設置allowEditing = YES
  2. 拍張照片
  3. 裁剪窗口出現,但每次我平移圖像時,它都會快速回到中心。

我在iOS 7.0.3上。

這是我的代碼:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

imagePicker.delegate = self;
imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePicker.allowsEditing = YES;
[self presentViewController:imagePicker animated:YES completion:nil];

你只需要寫下單行代碼。

UIImage *image = [info valueForKey:UIImagePickerControllerEditedImage];
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
            picker.delegate = self;
            picker.allowsEditing = YES; // YES
            picker.sourceType = UIImagePickerControllerSourceTypeCamera;
            [self presentViewController:picker animated:YES completion:NULL];

試試這個我認為你缺少sourceType上的UIImagePickerControllerSourceTypeCamera。 看看它是否有效。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM