LoginSignup
101
93

More than 5 years have passed since last update.

TabLayoutで設定できるattributes一覧

Posted at

DesignSupportLibraryがリリースされ、マテリアルデザインに沿ったアプリを実装しやすくなりました。その中の1つ、TabLayoutの属性についてまとめておきます。

基本的には、design/res/values/styles.xmlの40〜54行目を見れば何となくわかります。

属性 デフォルト メモ
tabIndicatorHeight 2dp 細めに感じるかもしれないが、ガイドラインを見ると2dpでいいっぽい。
tabIndicatorColor ?attr/colorAccent
tabTextAppearance @style/TextAppearance.Design.Tab
tabPadding 0
tabPaddingStart 12dp
tabPaddingTop 0
tabPaddingEnd 12dp
tabPaddingBottom 0
tabTextColor 0
tabSelectedTextColor ?android:textColorPrimary
tabMinWidth @dimen/tab_min_width デフォルトは72dp
tabMaxWidth @dimen/tab_max_width デフォルトは264dp
tabBackground ?attr/selectableItemBackground
tabContentStart 0
tabMode fixed scrollableにすると、横スクロール可能になる。
tabGravity fill centerにすると、中央寄せになる。

こちらもとても詳しくまとまっていて参考になります。
Android Support Library v22.2 の Design Support Libraryをひと通り使って罠を踏んだ
Android Design Support Libraryを使う

101
93
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
101
93