iphone - UIImagePicker allowsEditing卡在中心

标签 iphone ios uiimagepickercontroller

我有一个 UIImagePicker,它非常适合一种 UIImagePickerControllerSourceTypePhotoLibrary,但是当我使用 UIImagePickerControllerSourceTypeCamera 时,编辑框无法从图像的中心移动。因此,如果图片的高度大于宽度,则用户无法将编辑框移动到图片的顶部正方形。

有人知道为什么会这样吗?只有当源来自相机而不是库时才会发生这种情况。

编辑:一些代码!!!

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 6 中的一个错误...基本上您不能移动编辑框,除非您放大一点,否则它总是弹回到中间。希望他们能尽快解决这个问题。

关于iphone - UIImagePicker allowsEditing卡在中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12630155/

相关文章:

iphone - 将 AM/PM 添加到日期选择器?

iphone - UITableView 中的第二个 View 将不会显示从 JSON 解析的数据

ios - CSS3 下拉菜单和 iOS 问题

ios - 为什么我的图像在运行 iOS 6 的 iPod 上以纵向模式拍摄时被设置为 UIImageOrientationRight?

ios - ipad UIImagePickerController 预览时和拍摄风景时的尺寸不同

uiimagepickercontroller - 尝试在路径文件 :///var/mobile/Media/PhotoData/Photos. sqlite 中添加只读文件?

iphone - 在 iPhone 上使用 AVAudioPlayer 时崩溃

ios - 如何与世界各地的随机人进行匹配并跨设备发送数据?

ios - 如何将视频数据转换为NSURL

iphone - 我用MailCode写邮件客户端有点麻烦