【发布时间】:2014-08-20 07:41:56
【问题描述】:
UIImagePickerController 遇到了一个奇怪的问题。当我在 UICollectionViewCell 点击时将它呈现在我的 viewController 上时,它会变为空白。
如果我尝试在单击任何按钮时显示它,那么它工作正常。 我正在做的事情
-(void) LaunchCamera{
imagePicker=[[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.allowsEditing = YES;
if ([[[NSUserDefaults standardUserDefaults] valueForKey:kUserId] integerValue] == 1) {
imagePicker.videoMaximumDuration=8000.0f;
}else{
imagePicker.videoMaximumDuration=20.0f;
}
[self presentViewController:imagePicker animated:YES completion:nil];
}
知道为什么会这样吗?
【问题讨论】:
-
你试过在
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath;上写这个 -
实际上这个集合视图不在子viewController中,点击它时我会在它的父类中调用它的委托方法,然后我调用上面的方法来启动相机。
标签: iphone ios7 uicollectionview uiimagepickercontroller