UIImage with transparent rounded corners

后端 未结 5 2090
无人共我
无人共我 2020-12-03 15:50

I\'m using following code to add rounded corners to my UIImage, but the problem is that the rounded corners are showing \"white\" area instead of transparent or \"clear\". W

5条回答
  •  失恋的感觉
    2020-12-03 16:52

    Right after creating the bitmap context clear it with:

    CGContextClearRect (context, CGRectMake(0, 0, w, h));
    

提交回复
热议问题