PKCanvasView with transparent background / UIImageView overlay

Has anyone had success attempting to place a PKCanvasView in front of an image / UIImageView ?


Setting the canvas backgroundColor to clear appears to work correctly, however when finger/pencil touches down the background of the PKCanvasView reverts to black 100% alpha.


Thanks
Ben

Answered by brinkin in 374154022

I worked out the issue for anyone else having the same problem - you need to set isOpaque to false


canvasView = PKCanvasView()
canvasView.backgroundColor = .clear
canvasView.isOpaque = false
Accepted Answer

I worked out the issue for anyone else having the same problem - you need to set isOpaque to false


canvasView = PKCanvasView()
canvasView.backgroundColor = .clear
canvasView.isOpaque = false

Thanks so much for your code

PKCanvasView with transparent background / UIImageView overlay
 
 
Q