【发布时间】:2010-07-22 16:25:04
【问题描述】:
在我的应用程序中,我为用户提供了两个上传照片的选项:
- 拍照
- 从库中选择
我在委托方法中的 modalViewController 中呈现这张照片 - imagePickerController: didFinishPickingImage editingInfo: 通过创建带有 imageview 的 viewController 并在其中加载选定的图像。
使用照片库很好,但是在从相机拍照时,每当我在拍照后在委托方法中启动我的 modalViewController 时,视图都会向下移动近 20 个像素。此后,每当我返回时,所有视图都会发生变化。
编辑:
- (void)imagePickerController:(UIImagePickerController *)_picker1_ didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
imageUploadView = [[UIViewController alloc]initWithNibName:nil bundle:nil];
imageUploadView.view.frame = CGRectMake(0, 0, 320, 480);
[imageUploadView.view setBackgroundColor:[UIColor blackColor]];
imageUploadView.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
image = [[UIImageView alloc]init];
image.frame = CGRectMake(0, 60, 320, 270);
//I'm Adding different views like toolbar and barbuttons here
[_picker1_ presentModalViewController:imageUploadView animated:YES];
[image setImage:img];
}
我真的被困在这里了。
有人可以帮忙吗?这真的很紧急。
提前感谢。
【问题讨论】:
-
请至少在您的
didFinishPickingImage方法中发布代码。 -
20像素..这不是状态栏的高度吗??
-
是的..我不确定如何处理这种转变..我也尝试设置它的框架..
标签: iphone uiimagepickercontroller modalviewcontroller