iOS UIImagePickerController Bug

在测试项目中遇到使用UIImagePickerController上传用户头像时出现图片右侧黑色条纹的问题,原因是苹果SDK内部剪切范围计算错误。由于该问题未引起苹果注意,采取了自定义解决方案来修正剪切范围,成功解决了问题。
摘要由CSDN通过智能技术生成

这是在测试项目的时候,发现上传用户头像有一个问题,然后引发的探索:
代码:

/**
 修改头像
 */
- (void)modifyHeadshot {
    /*头像*/
    NSString *mediaType = AVMediaTypeVideo;
    AVAuthorizationStatus authorizationStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];
    if (authorizationStatus == AVAuthorizationStatusRestricted || authorizationStatus == AVAuthorizationStatusDenied) {
        /*询问是否允许使用照相机*/
        UIAlertController * alertC = [UIAlertController alertControllerWithTitle:@"摄像头访问受限" message:@"请去设置中修改权限" preferredStyle:UIAlertControllerStyleAlert];
        UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
            [self dismissViewControllerAnimated:YES completion:nil];
        }];
        [alertC addAction:action];
        [self presentViewController:alertC animated:YES completion:nil];
    }else{
        UIAlertController *alertController = [[UIAlertController alloc] init];
        UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"从手机相册选择" style:0 handler:^(UIAlertAction * _Nonnull action) {
            LOG(@"从手机相册选择"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值