Setting A CGContext Transparent Background

后端 未结 8 747
长发绾君心
长发绾君心 2020-12-08 09:15

I am still struggling with drawing a line with CGContext. I have actually go to line to draw, but now I need the background of the Rect to be transparent so the existing ba

8条回答
  •  轮回少年
    2020-12-08 10:01

    I have the same problem, then I find it is. I overwrite the init Method is -(id)initWithFrame:(CGRect)rect. In this method self.background = [UIColor clearColor]; but i use this view in xib file !!! That will call the init method is

    -(id)initWithCoder:(NSCoder*)aDecoder;
    

    So overwrite all the init Method and setup BackgroundColor will work OK.

提交回复
热议问题