新版本iOS17,運行會報UIGraphicsBeginImageContextWithOptions函數(shù)崩潰
在iOS17.0 版本中,如果此函數(shù)的size參數(shù)傳入的是(0,0),則會導致程序崩潰,報錯內(nèi)容如下:
Thread 1: "UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=3.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert."
解決辦法:
1、檢查傳入的size參數(shù)是否為(0,0),尤其是使用Masonry函數(shù)對視圖進行布局的文章來源:http://www.zghlxwxcb.cn/news/detail-751648.html
2、修改傳入的size參數(shù),問題解決文章來源地址http://www.zghlxwxcb.cn/news/detail-751648.html
到了這里,關于iOS-bug,Xcode,iOS17,“UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!