我有一个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