D
D
dimasik1002002018-02-16 21:42:40
JavaScript
dimasik100200, 2018-02-16 21:42:40

Why do tablayouts lose tab titles after using viewpager and blinking shadow after switching to another fragment in bottom navigat?

When working with tabs, I ran into two problems. The first is that when using the viewpager, the title of the active tabs disappears.
5a8724574054b939961829.png
Also I use bottom navigation in 5 fragments. In two, I turned on tablatout and when switching these fragments, the shadow under the tab layouts starts blinking. How to fix it all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dimasik100200, 2018-02-18
@dimasik100200

I fixed the tab title display problem by introducing a style for the tablayout, but the shadow continues to blink

<style name="AppTabLayout" parent="Widget.Design.TabLayout">
        <item name="tabIndicatorColor">@color/colorBlack</item>
        <item name="tabBackground">@color/colorWhite</item>
        <item name="tabTextAppearance">@style/AppTabTextAppearance</item>
        <item name="tabSelectedTextColor">@color/colorOrange</item>
    </style>

    <style name="AppTabTextAppearance" parent="TextAppearance.Design.Tab">
        <item name="android:textColor">@color/colorBlack</item>
    </style>

<android.support.design.widget.TabLayout
                android:id="@+id/tablayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/AppTabLayout"
                app:tabTextAppearance="@style/AppTabTextAppearance"
                app:tabMode="fixed"
                app:tabGravity="fill"/>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question