未知的进程名称。 CGBitmapContextGetHeight:无效的上下文(iOS12)

时间:2019-06-11 11:08:29

标签: ios swift

导入UIKit

CustomView类:UIView {

override func draw(_ rect: CGRect) {
    // Drawing code
    let context = UIGraphicsGetCurrentContext()
    let h = context?.height
    debugPrint(h) // printed value: Optional(0)

}

}

输出:

[ Unknown process name ] CGBitmapContextGetHeight: invalid context 0x----. 
If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

code test

0 个答案:

没有答案