我有一個UIImagePicker,適用於UIImagePickerControllerSourceTypePhotoLibrary類型的完美,但是當我使用UIImagePickerControllerSourceTypeCamera時,編輯框不能從圖像的中心移動。因此,如果圖像高於寬度,則用戶無法將編輯框移動到圖像的上方。UIImagePicker允許編輯卡在中心
任何人都知道爲什麼會這樣?它只發生在來源是相機而不是圖書館的情況下。
編輯:一些代碼!!!
if (actionSheet.tag == 2) {
if (buttonIndex == 0) { // Camera
// Check for camera
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == YES) {
// Create image picker controller
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
// Set source to the camera
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.allowsEditing = YES;
// Delegate is self
imagePicker.delegate = self;
// Show image picker
[self presentViewController:imagePicker
animated:YES
completion:^(void) {
}];
}
}
else if (buttonIndex == 1) { // Photo Library
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary] == YES) {
// Create image picker controller
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
// Set source to the camera
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.allowsEditing = YES;
// Delegate is self
imagePicker.delegate = self;
// Show image picker
[self presentViewController:imagePicker
animated:YES
completion:^(void) {
}];
}
}
所以你可以看到,我展示他們完全一樣的,但相機編輯的作用比照片庫編輯不同。
我認爲這仍然是iOS 7 –
aaa中的一個錯誤,並且仍然是iOS 8中的一個錯誤。:( –
即使是iOS 8.1也存在相同的錯誤 – Adnan