How do I remove dividers 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 set android:Divider
or anything I am used to. Does anyone have any idea how to remove them?
I think we can "hack" this by making the divider 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 told me whether it works or not. I never tested this code, but its working when i want to change my divider with my own image.
The ViewPager is just the view that allows you to swipe horizontally between views (usually fragments), by default it hasn't tabs. You should look for some informations about ActionBar.Tab (see here. http://developer.android.com/training/implementing-navigation/lateral.html#tabs)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With