美文网首页
YBImageBrowser 闪退

YBImageBrowser 闪退

作者: 黎先生_ | 来源:发表于2024-04-01 10:40 被阅读0次

报错:

warning: Module "/Users/xxx/Library/Developer/Xcode/iOS DeviceSupport/iPhone15,2 17.3.1 (21D61)/Symbols/usr/lib/libobjc.A.dylib" uses triple "arm64e-apple-ios17.3.0", which is not compatible with the target triple "arm64-apple-ios11.0.0". Enabling per-mod

解决方法:

UIImage *YBIBSnapshotView(UIView *view) {
//    UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, [UIScreen mainScreen].scale);
//    [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO];
//    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
//    UIGraphicsEndImageContext();
    
    CGSize size = view.bounds.size;
    UIGraphicsImageRendererFormat *format = [[UIGraphicsImageRendererFormat alloc] init];
    format.scale = [UIScreen mainScreen].scale;
    UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:size format:format];
    UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
    }];
    return image;
}

YYTextAsyncLayer 闪退

//        UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, self.contentsScale);
//        CGContextRef context = UIGraphicsGetCurrentContext();
//        if (self.opaque) {
//            CGSize size = self.bounds.size;
//            size.width *= self.contentsScale;
//            size.height *= self.contentsScale;
//            CGContextSaveGState(context); {
//                if (!self.backgroundColor || CGColorGetAlpha(self.backgroundColor) < 1) {
//                    CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
//                    CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));
//                    CGContextFillPath(context);
//                }
//                if (self.backgroundColor) {
//                    CGContextSetFillColorWithColor(context, self.backgroundColor);
//                    CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));
//                    CGContextFillPath(context);
//                }
//            } CGContextRestoreGState(context);
//        }
//        task.display(context, self.bounds.size, ^{return NO;});
//        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
//        UIGraphicsEndImageContext();
//        self.contents = (__bridge id)(image.CGImage);
        UIGraphicsImageRendererFormat *format = [[UIGraphicsImageRendererFormat alloc] init];
              format.opaque = self.opaque;
              format.scale = self.contentsScale;

              UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:self.bounds.size format:format];
              UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
                  CGContextRef context = rendererContext.CGContext;
                  if (self.opaque) {
                      CGSize size = self.bounds.size;
                      size.width *= self.contentsScale;
                      size.height *= self.contentsScale;
                      CGContextSaveGState(context); {
                          if (!self.backgroundColor || CGColorGetAlpha(self.backgroundColor) < 1) {
                              CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
                              CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));
                              CGContextFillPath(context);
                          }
                          if (self.backgroundColor) {
                              CGContextSetFillColorWithColor(context, self.backgroundColor);
                              CGContextAddRect(context, CGRectMake(0, 0, size.width, size.height));
                              CGContextFillPath(context);
                          }
                      } CGContextRestoreGState(context);
                  }
                  task.display(context, self.bounds.size, ^{return NO;});
              }];

              self.contents = (__bridge id)(image.CGImage);

相关文章

  • iOS Crash 闪退日志详细解析教程

    前言 查看闪退日志的步骤:(1)获取闪退日志(2)获取 symbolicatecrash 脚本(3)获取闪退日志对...

  • iOS crash 闪退日志

    前言 查看闪退日志的步骤(1)获取闪退日志(2)获取symbolicatecrash 脚本(3)获取闪退日志对应的...

  • iOS:保护App不闪退

    iOS:保护App不闪退 iOS:保护App不闪退

  • 闪退

    写了半天,竟然闪退了…… 这个APP究竟有多烂……

  • 闪退

    他来我们办公室的时间很短,就三个月,一个试用期而已。 自从试用期结束之后,他就像脱缰的野马一样,开始在朋友圈里各种...

  • 闪退

    无意间知道一些以前从未察觉的事情之后,才发现自己有多愚蠢。可是我自己怎么就会在知道真相以后还是要把自己给蠢哭,我到...

  • 闪退

    今天在家里看视频,突然出现闪退,让我觉得莫名其妙。 重新打开视频,过了几分钟,又没了。换个视频,发生同样的情况。 ...

  • 闪退

    我的手机,最近几天,总是闪退,正在用着软件,忽然一下子,就闪退了。还得重新登陆。这个现象每隔一段时间,就会出现一...

  • 闪退

    简书app最近特顽皮,每次抽空(把自己说特忙的感觉不错)戳进来时,他都给你来个里格楞,把你闪得开始怀疑人生。 由此...

  • 闪退

    不晓得啥情况,从昨天晚上到今天早上,以至现在,我进简书系统,都有点闪退,或者显示网络不通畅,而手机上其它的软件...

网友评论

      本文标题:YBImageBrowser 闪退

      本文链接:https://www.haomeiwen.com/subject/yjqitjtx.html