1
我有一個應用程序,使用UITabBarController
和其中一個標籤應該是一個完整的相機視圖(類似於Instagram)。當我啓動應用程序並轉到該視圖時,大部分屏幕都是空白的,並且沒有加載圖像庫選擇器/相機視圖。任何幫助將不勝感激。使UIViewController UIImagePicker點擊時
這裏是我的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];
}
也適合我!非常感謝!爲什麼是這樣? – user1530580 2012-07-17 05:05:09
我不確定,希望別人會發布原因。 – rdelmar 2012-07-17 05:11:03