(Sorry for my bad english) What i did is viewPager inside viewPager and i want to set Image and text to each tab with Padding. I want to do something like this - Mock up design
But so far I just added images to tab & margin. But I don't know why margin between tabs is not working? Here's my xml code -
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.ansh.customizingtab.MainActivity">
<android.support.design.widget.TabLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/tabLayout"
app:tabMode="scrollable"
app:tabGravity="fill"
android:layout_margin="10dp"
app:tabPaddingStart="8dp"
app:tabPaddingEnd="8dp"
app:tabBackground="@drawable/background_tab">
</android.support.design.widget.TabLayout>
<com.example.ansh.customizingtab.CustomViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
Which resulting this - Result image