ios - Working with transparency: View behind transparent view should only shine through and not overlap -
i'm working transparency , i'd have following effect:
as can see line takes full width of view. there transparent uiviews on screen. line seems below transparent uiview , if overlaps has color, because of transparent uiview above. when there no overlapping line normal color.
how can effect?
i tried set background of uiview transparent, didn't helped. line has normal color , doesn't interact transparency. furthermore tried change transparency of view same wrong result.
the rectangle above done code
uiview rectangle = new uiview (new cgrect (10, 10, 200, 120)); rectangle.backgroundcolor = uicolor.fromrgba (204,115,225, 50); uiview line = new uiview (new cgrect (0, 105, 320, 1)); line.backgroundcolor = uicolor.red; view.addsubview (line); view.addsubview (rectangle); line.sendsubviewtoback (rectangle);
the rectangle below created in ios designer.
am missing something?
its z order of subviews.
line.sendsubviewtoback (rectangle);
is not want.
if add line normal red color , add uiview has alpha dropped e.g. 0.5, should effect want.
Comments
Post a Comment