How to remove tab tab of Android ViewPager tabs?

How to remove separators from ViewPager?

Here is the code:

<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.bus.tralisto.MainActivity" /> 

I cannot install android:Divider or whatever I'm used to. Does anyone know how to remove them?

+5
source share
3 answers

I think we can β€œcrack” it by making the delimiter transparent:

 <style name="YourTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarTabBarStyle">@style/Divider</item> </style> <style name="Divider" parent="@android:style/Widget.Holo.ActionBar.TabBar"> <item name="android:divider">@android:color/transparent</item> //or use your transparent drawable image <item name="android:showDividers">middle</item> <item name="android:dividerPadding">0dp</item> </style> 

Please let me know if this works or not. I have never tested this code, but its working when I want to change my separator with my own image.

+5
source

ViewPager is just a view that allows you to scroll horizontally between views (usually fragments), by default it has no tabs. You should find some information about ActionBar.Tab (see here http://developer.android.com/training/implementing-navigation/lateral.html#tabs )

+1
source

You can use getTabHost (). getTabWidget (). SetDividerDrawable method (R.drawable.empty_divider)

0
source

Source: https://habr.com/ru/post/1206228/


All Articles