CGBitmapContextCreate: unsupported parameter combination: set CGBITMAP_CONTEXT_LOG_ERRORS environmental variable to see the details
CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
出現(xiàn)上面錯(cuò)誤的原因,本人不太清楚,出現(xiàn)的環(huán)境iOS 12.0.1 iPhone 6;但是在iPhoneX模擬器上沒(méi)出現(xiàn)
根據(jù)自己測(cè)試,找到了解決方案
傳過(guò)去的image有問(wèn)題,將圖片轉(zhuǎn)為NSData就可以了
[UIImage imageNamed:@"banner"]// 這個(gè)傳過(guò)去圖片不行
// 這樣傳過(guò)去的圖片可以,將圖片包一下既可以了 jpeg,png都可以
[UIImage imageWithData:UIImagePNGRepresentation([UIImage imageNamed:@"banner"])]