IOS17闪退问题Assertion failure in void _UIGraphicsBeginImageContextWithOptions

最近项目更新到最新版本IOS17,发现一个以前的页面突然闪退了。原来是IOS17下,这个方法

objectivec 复制代码
UIGraphicsBeginImageContext(CGSize size)

已经被移除,原参数如果size为0的话,会出现闪退现象。

根据说明,上述方法已经被替换为

这时候,我们就改为新方法

objectivec 复制代码
UIGraphicsImageRenderer *re = [[UIGraphicsImageRenderer alloc] initWithSize:view.bounds.size];

则程序可以顺利运行。

相关推荐
初级代码游戏3 天前
easy Photo Clean公测版:快速清理iPhone照片 邀请公测
ios·iphone
库奇噜啦呼3 天前
【iOS】RunLoop学习
学习·ios
黑科技iOS上架3 天前
iOS应用周末提交什么情况算卡审
经验分享·ios
zzb15803 天前
ios基础-MVC-UIView
ios·mvc·cocoa
kingbal3 天前
Flutter:Flutter SDK版本管理工具FVM
android·flutter·ios·android-studio·window
他们都不看好你,偏偏你最不争气4 天前
【iOS】Runtime - Part 2 && 消息发送:缓存、查找与转发
macos·ios·objective-c·cocoa
2501_915918414 天前
iOS App性能测试工具的实现方法与优化循环指南
android·ios·小程序·https·uni-app·iphone·webview
他们都不看好你,偏偏你最不争气4 天前
【iOS】Runtime - Part 1 && 对象与类的本质
macos·ios·objective-c·cocoa