Reputation: 1667
I use Android Tab Example for navigation.
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_above="@+id/lay_bot"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="?attr/colorPrimary"
android:elevation="4dp"
app:tabIndicatorColor="@color/tabIndicatorColor"
app:tabIndicatorHeight="6dp"
app:tabMaxWidth="0dp"
app:tabTextColor="@android:color/holo_green_light" />
But, i don't know how to show tabs indicator only (without text of tabs). For exampe:
If you know how to do it, can you help me?
Upvotes: 0
Views: 1104
Reputation:
Replace following line
android:layout_height="?attr/actionBarSize"
With
android:layout_height="6dp"
And make sure that u don't provide tab names.
Upvotes: 3
Reputation: 21043
Just set the height as same as indicator height and pass empty String
as page title(Not neccesary).
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_above="@+id/lay_bot"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="?attr/colorPrimary"
android:elevation="4dp"
app:tabIndicatorColor="@color/tabIndicatorColor"
app:tabIndicatorHeight="6dp"
app:tabMaxWidth="0dp"
app:tabTextColor="@android:color/holo_green_light" />
Upvotes: 0