相机控件在iOS 7上不可见

时间:2013-12-02 11:29:38

标签: ios

我使用Image Picker Controller来调用设备相机。下面列出的代码在iOS 7下工作正常。但是当我在iOS 7上使用相同代码启动相机时,我无法看到“使用”和“取消”按钮。

- (void)getCameraPicture {

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
[self presentViewController:picker animated:YES completion:NULL];

}

感谢任何帮助。 Please find the screenshot to see the problem

更新

当我尝试在示例应用程序中运行此代码时,它可以正常工作。(示例应用程序包含单个视图)。但是,当我把它放在我的项目中时,按钮不显示。

2 个答案:

答案 0 :(得分:2)

代码中的

应该在那里:

 ...

 picker.showsCameraControls = YES;

答案 1 :(得分:1)

你在UIImagePickerController中检查了这个@property (nonatomic) BOOL showsCameraControls

相关问题