gpt4 book ai didi

iphone - 仅在 iOS 6.0 中,UIImagePickerController 关闭时将 View 向上推至 20 px

转载 作者:行者123 更新时间:2023-11-29 03:54:12 25 4
gpt4 key购买 nike

编辑:我正在使用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:^{
}];
}

现在view变成这样,如fiqure所示:

enter image description here

编辑:关闭时 View 会被推至 20px。

编辑:这仅适用于 iOS 6.0

最佳答案

原因是我正在 View Controller 设置框架,该 Controller 处于protrait模式作为其上一个 View 处于横向模式

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

每当imagepicker dissmiss调用时,它移动原始位置提到

现在更改了结构方向无需在外部设置self.view框架解决了我的问题.

关于iphone - 仅在 iOS 6.0 中,UIImagePickerController 关闭时将 View 向上推至 20 px,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16705893/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com