ios - Working with transparency: View behind transparent view should only shine through and not overlap -


i'm working transparency , i'd have following effect:

line behind transparent uiview

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.

some tries replicate effect

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

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -