Reputation: 1695
I read documentation about TabLayout
for add property to make border on top of TabLayout
but I didn't find it anywhere in documentation.
So I want some trick to make TabLayout
have border on top (or maybe at bottom).
Upvotes: 0
Views: 10552
Reputation: 1695
Solved with this drawable xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#FFDDDDDD" />
<solid android:color="#FFFFFFFF" />
</shape>
</item>
<item
android:top="1dp">
<shape android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#FFFFFFFF" />
<solid android:color="#00000000" />
</shape>
</item>
</layer-list>
and set into tablayout attribute/property:
android:background="@drawable/drawableName"
Upvotes: 3
Reputation: 47
you have to create a drawable, then call in this way
android:background="@drawable/yourShapeHere"
the drawable is looks like:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<stroke android:width="2dp" android:color="#515151"/>
<corners android:radius="3dp" />
<padding android:left="10dp" android:top="5dp" />
</shape>
Upvotes: 1