我有一个使用 的应用程序,UITabBarController
其中一个选项卡应该是完整的相机视图(类似于 Instagram)。当我启动应用程序并转到该视图时,大部分屏幕都是空白的,并且没有加载图像库选择器/相机视图。任何帮助将不胜感激。
这是我的viewDidLoad
方法:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
imagePicker = [[UIImagePickerController alloc] init];
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
} else {
[imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
}
[imagePicker setDelegate:self];
[imagePicker setEditing:NO];
// Place image picker (camera viewing angle on the screen)
[self presentViewController:imagePicker animated:YES completion:nil];
}