2016-10-28 11 views
1

TabLayoutのタブ項目の幅を小さくする必要があります。私は解決策を見つけるのに多くの時間を費やしましたが、それは簡単ではないようです。ここに私のレイアウトは次のとおりです。アンドロイドのTabLayoutでタブ項目の幅を減らす方法は?

<android.support.v4.view.ViewPager 
    android:id="@+id/pager_chapter" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" /> 

<android.support.design.widget.TabLayout 
    android:id="@+id/tabs_chapter" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    app:tabMode="scrollable" /> 

答えて

0

変更アンドロイド:layout_width = "match_parent"へのandroid:layout_width = "wrap_content" TabLayoutビュー内

0

これは仕事かもしれません!

<android.support.design.widget.TabLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     app:tabMaxWidth="0dp" 
     app:tabGravity="fill" 
     app:tabMode="fixed" /> 
+0

ありがとうございました。これにより、タブ項目が非表示になります。 –

関連する問題