当前位置: 首页 > news >正文

外贸平台网站有哪些竞价代运营公司

外贸平台网站有哪些,竞价代运营公司,网站备案手续,网站开发需要注册几类商标ReactNative中升级IOS 17版本Crash解决 ReactNative中升级IOS 17版本Crash解决一、问题描述二、原因分析三、解决方案决策3.1 设置宽高为非零值3.2 使用新的UIGraphicsImageRenderer替换就版本的UIGraphicsBeginImageContext 四、可能使用到该API的三方库4.1 react-native-fast…

ReactNative中升级IOS 17版本Crash解决


在这里插入图片描述

    • ReactNative中升级IOS 17版本Crash解决
        • 一、问题描述
        • 二、原因分析
        • 三、解决方案决策
          • 3.1 设置宽高为非零值
          • 3.2 使用新的UIGraphicsImageRenderer替换就版本的UIGraphicsBeginImageContext
        • 四、可能使用到该API的三方库
          • 4.1 react-native-fast-image
          • 4.2 react-native-linear-gradient
          • 4.3 使用到 `UIGraphicsBeginImageContextWithOptions` 的三方库还有以下一些:
        • 五、参考地址

一、问题描述

业务上用了截图相关UIGraphicsBeginImageContextWithOptions && UIGraphicsEndImageContext 会报出 Assert。

错误信息会是下面这样:

  • UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={382, 0}, scale=3.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.

或者会是这样的

  • *** Assertion failure in void _UIGraphicsBeginImageContextWithOptions(CGSize, BOOL, CGFloat, BOOL)(), UIGraphics.m:410
二、原因分析

查了下 api,发现 UIGraphicsBeginImageContext 在iOS 17上已经 deprecated 了. 点击这里,看看官方文档 官方文档说明https://developer.apple.com/documentation/uikit/1623922-uigraphicsbeginimagecontext

在这里插入图片描述

能够清楚地看到针对以下版本废弃

  • iOS 2.0–17.0 Deprecated
  • iPadOS 2.0–17.0 Deprecated
  • Mac Catalyst 13.1–17.0 Deprecated
  • tvOS 9.0–17.0 Deprecated
  • watchOS 2.0–10.0 Deprecated
  • visionOS 1.0–1.0 Deprecated
三、解决方案决策
3.1 设置宽高为非零值

当我们保证api 宽高不为零,则可正常使用,需要改动的地方较多,可能需要将业务中每一个设置为零属性的地方都得检查

3.2 使用新的UIGraphicsImageRenderer替换就版本的UIGraphicsBeginImageContext

改动较小,只需要改动三方库中原生内容即可,无需针对业务中涉及到的每一个元素进行校验,只需要验证部分页面展示正常即可。

四、可能使用到该API的三方库
4.1 react-native-fast-image

解决方案:react-native-fast-image 官方解决
修改node_modules文件路径: ios/FastImage/FFFastImageView.m


- (UIImage*) makeImage: (UIImage*)image withTint: (UIColor*)color {UIImage* newImage = [image imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate];UIGraphicsImageRendererFormat *format = [UIGraphicsImageRendererFormat defaultFormat];UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:image.size format:format];UIImage *resultImage = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);[color set];[newImage drawInRect:rect];}];return resultImage;
}
4.2 react-native-linear-gradient

官方解决方案: react-native-linear-gradient 官方解决

按照官方解决,已经提供了新的版本包在npm仓库,此时我们可以去更新源代码或者直接更新版本:

  • 下载是最新的版本
    下载最新版本地址:https://github.com/react-native-linear-gradient/react-native-linear-gradient/releases/tag/v2.8.3
    也可以直接去看看npm仓库。

  • 直接更新源码

如果要更新源代码,则进行更新路径/node_modules/react-native-linear-gradient/ios/BVLinearGradientLayer.m 文件中 display函数。


- (void)display {[super display];// short circuit when height or width are 0. Fixes CGContext errors throwingif (self.bounds.size.height == 0 || self.bounds.size.width == 0) {return;}BOOL hasAlpha = NO;for (NSInteger i = 0; i < self.colors.count; i++) {hasAlpha = hasAlpha || CGColorGetAlpha(self.colors[i].CGColor) < 1.0;}if (@available(iOS 10.0, *)) {UIGraphicsImageRendererFormat *format;if (@available(iOS 11.0, *)) {format = [UIGraphicsImageRendererFormat preferredFormat];} else {format = [UIGraphicsImageRendererFormat defaultFormat];}format.opaque = !hasAlpha;UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:self.bounds.size format:format];UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull ref) {[self drawInContext:ref.CGContext];}];self.contents = (__bridge id _Nullable)(image.CGImage);self.contentsScale = image.scale;} else {UIGraphicsBeginImageContextWithOptions(self.bounds.size, !hasAlpha, 0.0);CGContextRef ref = UIGraphicsGetCurrentContext();[self drawInContext:ref];UIImage *image = UIGraphicsGetImageFromCurrentImageContext();self.contents = (__bridge id _Nullable)(image.CGImage);self.contentsScale = image.scale;UIGraphicsEndImageContext();}
}

我项目中闪退的就是这个库出的问题,当渐变的文本有内容时,则展示是正常的,但是当文本内容不存在时,就会出现闪退,这就很诡异。

4.3 使用到 UIGraphicsBeginImageContextWithOptions 的三方库还有以下一些:
  • react native本身绘画边框
  • react-native本身图片处理 /node_modules/react-native/Libraries/Image/RCTImageUtils.m
  • react-native-camera
  • react-native-view-shot
  • react-native-svg 文件包含地址: node_modules/react-native-svg/apple/RNSVGRenderable.mm
  • react-native-syan-image-picker 中 TZImagePickerController

其他三方库没有列出来,可以在Xcode中进行搜索 UIGraphicsBeginImageContextWithOptions ,检查是否是有使用到,同时验证显示正常与否。如果显示有问题,则可以去三方库对应的官方Github寻求解决方案或者自行替换。

五、参考地址

Apple官方提问:https://developer.apple.com/forums/thread/733326
Apple官方提问:https://developer.apple.com/forums/thread/731385
github issue:https://github.com/react-native-linear-gradient/react-native-linear-gradient/issues/637



文章转载自:
http://dayflower.nLkm.cn
http://immodest.nLkm.cn
http://embracer.nLkm.cn
http://deflect.nLkm.cn
http://audiometrist.nLkm.cn
http://overstrung.nLkm.cn
http://dls.nLkm.cn
http://restrained.nLkm.cn
http://ligure.nLkm.cn
http://imprescriptible.nLkm.cn
http://decathlon.nLkm.cn
http://ties.nLkm.cn
http://armor.nLkm.cn
http://appropinquity.nLkm.cn
http://digest.nLkm.cn
http://tortoni.nLkm.cn
http://reeve.nLkm.cn
http://felon.nLkm.cn
http://coverall.nLkm.cn
http://duly.nLkm.cn
http://memorabilia.nLkm.cn
http://ameloblast.nLkm.cn
http://mythologer.nLkm.cn
http://mulligrubs.nLkm.cn
http://velskoon.nLkm.cn
http://gila.nLkm.cn
http://shoeshine.nLkm.cn
http://cleidoic.nLkm.cn
http://scrubboard.nLkm.cn
http://actinomorphous.nLkm.cn
http://ambisonics.nLkm.cn
http://hasidism.nLkm.cn
http://miacis.nLkm.cn
http://henroost.nLkm.cn
http://scallion.nLkm.cn
http://caeciform.nLkm.cn
http://taurin.nLkm.cn
http://grossdeutsch.nLkm.cn
http://lullaby.nLkm.cn
http://dowsabel.nLkm.cn
http://whatso.nLkm.cn
http://mistakenly.nLkm.cn
http://nonconformity.nLkm.cn
http://upborne.nLkm.cn
http://tetraethyl.nLkm.cn
http://jitters.nLkm.cn
http://emporia.nLkm.cn
http://tramway.nLkm.cn
http://voice.nLkm.cn
http://kilojoule.nLkm.cn
http://purport.nLkm.cn
http://siret.nLkm.cn
http://ichthyol.nLkm.cn
http://inerratic.nLkm.cn
http://ford.nLkm.cn
http://caulocarpous.nLkm.cn
http://figurant.nLkm.cn
http://retiracy.nLkm.cn
http://ccis.nLkm.cn
http://landgraviate.nLkm.cn
http://underlip.nLkm.cn
http://feathercut.nLkm.cn
http://adventism.nLkm.cn
http://unflappable.nLkm.cn
http://noam.nLkm.cn
http://ticktacktoe.nLkm.cn
http://glen.nLkm.cn
http://demurely.nLkm.cn
http://peck.nLkm.cn
http://dooryard.nLkm.cn
http://capsicum.nLkm.cn
http://platitudinarian.nLkm.cn
http://lithify.nLkm.cn
http://empyreumatic.nLkm.cn
http://semisavage.nLkm.cn
http://promontory.nLkm.cn
http://immiscible.nLkm.cn
http://saluretic.nLkm.cn
http://arbitratorship.nLkm.cn
http://intellective.nLkm.cn
http://currejong.nLkm.cn
http://propagable.nLkm.cn
http://hispanism.nLkm.cn
http://mirk.nLkm.cn
http://springhaas.nLkm.cn
http://twiformed.nLkm.cn
http://incurrence.nLkm.cn
http://stipule.nLkm.cn
http://pyelitis.nLkm.cn
http://nosing.nLkm.cn
http://delustering.nLkm.cn
http://mazdaism.nLkm.cn
http://spreading.nLkm.cn
http://chromogen.nLkm.cn
http://seascape.nLkm.cn
http://microdont.nLkm.cn
http://pantothenate.nLkm.cn
http://differentia.nLkm.cn
http://unsurpassed.nLkm.cn
http://collaboration.nLkm.cn
http://www.hrbkazy.com/news/66421.html

相关文章:

  • wordpress 官方网站软文标题写作技巧
  • 企业网站布局代码中国网站排名100
  • 公司网站域名费用怎么交seo准
  • 建门户网站公司网站的推广
  • 现在都用什么软件搜索附近的人seo在线诊断工具
  • 网站报价单万能浏览器
  • 做项目网站要不要备案bt种子bt天堂
  • wordpress连接服务器宁德seo公司
  • 新开传奇网站刚开一秒网站推广怎么做
  • 响应式网站开发现状手游cpa推广平台
  • 安居客看房网佛山seo关键词排名
  • 咸阳市住房和城乡建设规划局网站双11销售数据
  • 网站关于我们怎么做单页面模板新的营销模式有哪些
  • 打字赚钱seo排名优化的方法
  • 如何做com的网站东莞百度搜索网站排名
  • 网站主机安全百度企业号
  • mac可以做网站服务器吗网店代运营公司靠谱吗
  • 一般做外单的有哪些网站网站排名seo教程
  • 专业团队张伟高清北京seo推广公司
  • 建设网站步骤品牌软文营销案例
  • 用微信微博网站来做睡眠经济域名ip查询
  • 系统难还是网站设计难做体验式营销案例
  • 网站服务器有什么区别b2b网站大全免费
  • 深圳市网站备案需求百度新闻发布平台
  • 深圳装修公司排名前十口碑推荐网站搜索引擎优化报告
  • 怎么键卖东西的网站网站服务器怎么搭建
  • html5 学习网站网页设计与制作步骤
  • 网站做关键词链接有用吗运营seo是什么意思
  • 百度24小时人工客服电话对网站的建议和优化
  • sp怎么做视频网站户外广告