Issue
I'm trying to create a drawable with two shapes next to each other using layer-list, how would I do it?
Solution
You can use the following code to have the drawable you want(Change the colors and height as you want)
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:gravity="center">
<shape android:shape="rectangle">
<size
android:width="5dp"
android:height="5dp" />
<solid android:color="@color/colorAccent"/>
</shape>
</item>
<item android:gravity="right">
<shape android:shape="rectangle">
<size
android:width="1dp"
android:height="5dp" />
<solid android:color="@color/colorPrimary"/>
</shape>
</item>
</layer-list>
Answered By - sanoJ
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.