How to fit the tab width screen in android -


i implement tab layout using android support library , looks like

enter image description here

here tab width not fit screen , layout

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">       <android.support.design.widget.tablayout         android:id="@+id/sliding_tabs"          android:layout_width="match_parent"         android:layout_height="wrap_content"         app:tabmode="scrollable" />      <android.support.v4.view.viewpager         android:id="@+id/viewpager"         android:layout_width="match_parent"         android:layout_height="0px"         android:layout_weight="1"         android:background="@android:color/white" />  </linearlayout> 

try calling methods on tablayout:

tablayout.settabmode(tablayout.mode_fixed); tablayout.settabgravity(tablayout.gravity_fill); 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -