如何在iOS中从相机中选择音量增大按钮动作?

时间:2016-04-06 03:16:02

标签: ios objective-c iphone camera

我得到了音量增大动作的动作但是在出现相机音量增大按钮后不再工作。如果我关闭相机然后它正在工作。 请帮我。 我正在使用像这样的音量增大按钮动作代码:

self.volumeButtonHandler = [JPSVolumeButtonHandler volumeButtonHandlerWithUpBlock:^{
        [self click_Volume];
    } downBlock:^{
        NSLog(@"Down");
    }];

我正在使用下面的代码拍照。

 UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
    imagePickerController.sourceType = sourceType;
    imagePickerController.delegate = self;
    imagePickerController.showsCameraControls=YES;
    if (sourceType == UIImagePickerControllerSourceTypeCamera)
    {
        imagePickerController.showsCameraControls = NO;

        [[NSBundle mainBundle] loadNibNamed:@"OverlayView" owner:self options:nil];
        self.overlayView.frame = imagePickerController.cameraOverlayView.frame;
        imagePickerController.cameraOverlayView = self.overlayView;
        layout=[[UICollectionViewFlowLayout alloc] init];
        collView_Product = [[UICollectionView alloc] initWithFrame:CGRectMake(0,self.overlayView.frame.size.height-200,self.view.frame.size.width,100) collectionViewLayout:layout];
        [layout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
        [collView_Product setDataSource:self];
        [collView_Product setDelegate:self];
        collView_Product.scrollEnabled = YES;
        collView_Product.pagingEnabled = NO;
        [collView_Product registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"cellIdentifier"];
        [collView_Product setBackgroundColor:[UIColor colorWithRed:49.0/255.0 green:53.0/255.0 blue:60.0/255.0 alpha:0.8]];
        layout.minimumInteritemSpacing =-2;
        layout.minimumLineSpacing = -1;
        [collView_Product setPagingEnabled:YES];
        [self.overlayView addSubview:collView_Product];
      self.overlayView = nil;
    }
    self.imagePickerController = imagePickerController;
    [self presentViewController:self.imagePickerController animated:YES completion:nil];

0 个答案:

没有答案