UIImagePickerController相机拍照添加定位图片

// 拍照区域下移
        CGSize screenBounds = [UIScreen mainScreen].bounds.size;
        CGFloat topHeight = 44.0; // 顶部闪光灯高度  iPhone X 再 + 状态栏高度44.0
        CGFloat bottomHeight = 123.0; // 底部按钮区域高度  iPhone X 再 + 底部功能条高度34.0
        CGFloat camHeight = screenBounds.height - topHeight - bottomHeight;
        _imagePickerVc.cameraViewTransform = CGAffineTransformMakeTranslation(0, (screenBounds.height - camHeight) / 2.0 - topHeight);
        
        // 添加头像框
        UIView *tempView = [[UIView alloc] initWithFrame:CGRectMake((screenBounds.width - 130.0)/2.0, (screenBounds.height - 130.0)/2.0, 130.0, 130.0)];
        UIImageView *layView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 130.0, 130.0)];
        layView.image = [UIImage imageNamed:@"AlbumAddBtn"];
        [tempView addSubview:layView];
        [_imagePickerVc.view addSubview:tempView];

你可能感兴趣的:(UIImagePickerController相机拍照添加定位图片)