开发者

Core Graphics: How to draw overlapped semi transparent rectangle without changing color of the common area

When two semi-transparent overlaps, the part in the middle will combines and blends into a darker color. Is there any way to draw rect as usual, but keep the overlapped part sam开发者_如何学JAVAe color and transparency as remaining part of the rect?


You could calculate the intersection with

rect = CGRectIntersection(bottomRect, topRect)

Then draw the bottomRect, then fill the calculated rect with the default solid background color and draw the topRect on top of it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜