UISmagePickerController在被解雇时仅在iOS 6.0中将视图推送到20像素 [英] UIImagePickerController when dismissed pushes view to 20 px up in iOS 6.0 only

查看:93
本文介绍了UISmagePickerController在被解雇时仅在iOS 6.0中将视图推送到20像素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:我正在使用 UIStoryBoard

我有已提交,如下所示:

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

imagePicker.delegate = self;

imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; //| UIImagePickerControllerSourceTypeSavedPhotosAlbum ;
imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage,nil];

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
    {
        imagePicker.allowsEditing = YES;
        [self.navigationController presentViewController:imagePicker animated:YES completion:^{

        }];  
    }
}

现在当被解雇时

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
   UIImage *image = info[UIImagePickerControllerEditedImage];
    NSLog(@"Image : %@",image);
    [self dismissViewControllerAnimated:YES completion:^{
    }];
}

现在查看成为像这样,如 fiqure 所示:

Now view becomes like this as shown in fiqure :

编辑:当被解雇时,视图会被提升至20像素。

EDIT : view gets pushed up to 20px when dissmissed.

编辑:这仅适用于iOS 6.0

EDIT : This is only in iOS 6.0 only

推荐答案

原因是我设置框架 视图控制器这是 protrait模式因为上一个视图处于横向模式

The reason was i was setting frame of view controller which is in protrait mode as its previous view was in landscape mode.

self.view.bounds = CGRectMake(0,0,...,...);

每当 imagepicker dissmiss 得到移动原始位置 as 提到

Whenever imagepicker dissmiss got called it moved to original position as mentioned.

现在已在结构中更改 for orientation ,无需在外部设置self.view框架 已解决我的问题

Now changed in structure for orientation without setting self.view frame externally solved my problem.

这篇关于UISmagePickerController在被解雇时仅在iOS 6.0中将视图推送到20像素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆