Answer the question
In order to leave comments, you need to log in
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.
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
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 questionAsk a Question
731 491 924 answers to any question