Issue
How can I specify the width of an XML drawable when using a layer-list
? I want the width of the drawable (as a whole) to be set to 20dp but I don't where/how to set this + the preview pane doesn't help that much either.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/blue" />
</shape>
</item>
<item android:left="8dp" android:right="8dp">
<shape>
<solid android:color="#fff" />
</shape>
</item>
</layer-list>
Solution
You could try this:
<shape>
<solid android:color="#fff"/>
<size android:height="10dp" android:width="20dp"/>
</shape>
Answered By - santosh kumar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.