0

(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

Ansh
  • 365
  • 6
  • 19
  • Show the code for **CustomViewPager**. Try using "wrap_content" for the width and force wrap_content for the height. – Geet Choubey Jul 26 '16 at 06:47
  • well there's nothing in CustomViewPager right now. I just used it to disable swiping effect.! @GeetChoubey – Ansh Jul 26 '16 at 07:40

0 Answers0