我使用了avcapture的演示示例,我想在viewcontroller中的imagview中显示图像后拍照我已经使用了代码
{
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
NSInteger numberOfAssets = [group numberOfAssets];
if (numberOfAssets > 0) {
NSInteger lastIndex = numberOfAssets-1;
[group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:lastIndex] options:0 usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
UIImage *thumbnail = [UIImage imageWithCGImage:[result thumbnail]];
if (thumbnail && thumbnail.size.width > 0) {
imagviewlastimage.image = thumbnail;
*stop = YES;
}
}];
}
} failureBlock:^(NSError *error) {
NSLog(@"error: %@", error);
}];
从照片库中获取最后一张图片,但我正在拍摄第二张图片
并在我在
中写入的选择图像后重定向viewControllercaptureManagerStillImageCaptured:(AVCamCaptureManager *)captureManager delegate
ViewController *temp=[[ViewController alloc]init];
temp.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:temp animated:YES];
用作这个,如何解决这个问题?拍照后暂停屏幕