TabLayout was introduced to help developers meet Material Design standards. In this case, this is the corresponding tab height, the indent between the icon and text and the icon and text size. Check out the Material Design Guide to familiarize yourself with them.
However, if you really do not like the filling (and you do not want to create the application in accordance with the recommendations for the design of materials), you can change it.
You can use @ user13 answer . That way you can convey your layout.
However, remember that if you want to build TabLayout more dynamically and use its TabLayout.Tab#setText(java.lang.CharSequence) and TabLayout.Tab#setIcon(int) you should use this layout:
<ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@android:id/icon"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0" android:id="@android:id/text1" android:gravity="center" android:layout_below="@android:id/text1" />
Look at the identifiers @android:id/icon and @android:id/text1 . If you add these IDs, TabLayout your layout will work with the TabLayout class. See the documentation for more information.
R. Zagรณrski
source share