iOS7 中的 UIImagePickerController

Posted

技术标签:

【中文标题】iOS7 中的 UIImagePickerController【英文标题】:UIImagePickerController in iOS7 【发布时间】:2013-11-07 10:20:38 【问题描述】:

如何在 ios 7 中获取 UIImagePickerController 看起来与未使用 Overlay Controller 的附加屏幕截图中显示的屏幕相同。

这是用于选择器控制器的代码。

UIImagePickerController  *eImagePickerController = [[UIImagePickerController alloc] init];
eImagePickerController.delegate=self;


eImagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
eImagePickerController.cameraDevice = UIImagePickerControllerSourceTypeCamera;
eImagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
eImagePickerController.showsCameraControls = YES;
eImagePickerController.navigationBarHidden = NO;
eImagePickerController.cameraDevice=UIImagePickerControllerCameraDeviceRear;
eImagePickerController.wantsFullScreenLayout = NO;
eImagePickerController.cameraViewTransform = CGAffineTransformScale(eImagePickerController.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y);

[self presentViewController:eImagePickerController animated:YES completion:nil];

问题如附件截图所示

【问题讨论】:

您发布的代码有什么问题,请详细说明您遇到的问题。 不用大喊大叫。但是你的意思是:顶栏 likr 导航栏? 【参考方案1】:

以下代码将以类似于给定屏幕截图的方式显示UIImagePickerController

UIImagePickerController  *eImagePickerController = [[UIImagePickerController alloc] init];
eImagePickerController.delegate = self;

eImagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
eImagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
eImagePickerController.cameraDevice= UIImagePickerControllerCameraDeviceRear;
eImagePickerController.showsCameraControls = YES;
eImagePickerController.navigationBarHidden = NO;

[self presentViewController:eImagePickerController animated:YES completion:nil];

只需确保隐藏状态栏,否则它也会显示在UIImagePickerController 中。

【讨论】:

以上是关于iOS7 中的 UIImagePickerController的主要内容,如果未能解决你的问题,请参考以下文章

iOS7中的UITabBar徽章位置

iOS7 中的 UIImagePickerController

关于 iOS7 中的 AlertView App Crash

IOS7:UINavigationController 中的 UIScrollView 偏移

iOS7中的UIKeyboard

iOS7中的UIVisualEffectView