Thursday, 4 October 2018

Support Library Version 28.0.0 TabLayout bug

After updating to the latest version of the support library (27.1.1 -> 28.0.0), there are problems with the user interface.

an issue: enter image description here

a desired state: enter image description here

tab_layout_unselected_indicator.xml:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:left="-5dp"
        android:right="-5dp"
        android:top="-5dp">
        <shape>
            <stroke
                android:width="2dp"
                android:color="@color/colorGrey" />
        </shape>
    </item>
</layer-list>

tab_layout:

<android.support.design.widget.TabLayout
        android:id="@+id/tab_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorBlackDark"
        android:theme="@style/AppTheme.AppBarOverlay"
        app:tabBackground="@drawable/tab_layout_unselected_indicator"
        app:tabIndicatorColor="@color/colorOrange"
        app:tabMode="fixed"
        app:tabSelectedTextColor="@color/colorOrange"
        app:tabTextAppearance="@style/StrikeCustomTabText"
        app:tabTextColor="@color/colorGrey" />

It looks like the background of one tab crosses the other. I tried to change the indent and noticed this. Now I'm using a previous version of the support library (27.1.1). How can I fix this for the current version of the support library (28.0.0)?



from Support Library Version 28.0.0 TabLayout bug

No comments:

Post a Comment