Android : Android :: Layer-List 3 vertical rectangle stack issue

on Friday, July 25, 2014


PROBLEM


I want to create 3 rectangles in the vertical. Then, I want the first and the last one transparent. but the result look like the second rectangle height is bigger than it should be (its height big equal 2 rectangle)


PICTURE


Before it transparent... enter image description here


After it transparent... enter image description here


What I want... enter image description here


XML LAYER-LIST



<layer-list xmlns:android= "http://schemas.android.com/apk/res/android">

<item android:top="0dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/transparent"/>
<size android:height="5dp" android:width="20dp"/>
</shape>
</item>

<item android:top="5dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/holo_green_light"/>
<size android:height="5dp" android:width="20dp"/>
</shape>
</item>

<item android:top="10dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/transparent"/>
<size android:height="5dp" android:width="20dp"/>
</shape>
</item>

</layer-list>

0 comments:

Post a Comment