【发布时间】:2016-12-09 06:32:53
【问题描述】:
编辑:我正在使用UIStoryBoard。
我有这样的presented:
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:^{
}];
}
}
现在当dissmissed
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = info[UIImagePickerControllerEditedImage];
NSLog(@"Image : %@",image);
[self dismissViewControllerAnimated:YES completion:^{
}];
}
现在view 变成了fiqure 中所示的样子:
EDIT:视图在关闭时被推到 20px。
编辑:这仅在 iOS 6.0 中
【问题讨论】:
-
你在这个屏幕上有标签栏吗?还是您在任何地方设置视图框架?因为我也在我的应用程序中运行相同的代码,它工作正常。
-
是的,我正在设置 [self.navigationController.view setBounds:CGRectMake(0, 0, 320, 480)];在 viewDidLoad 方法中
-
蓝色部分是 UIView 还是导航栏?
-
是的它的 UIImageView !!!!!!!
-
我只在 iOS 6 中遇到过这些问题,而且还没有看到 iOS 7.0
标签: iphone ios objective-c uiimagepickercontroller