I\'m trying to use the new TabLayout in the android design library to create app bar with icons.
public void setupTabLayout(TabLayout tabLayout) {
tabLayout
You can use the attribute android:layout
of TabItem
to set custom view.
In custom view xml file, remember to set id
of icon and text view to @android:id/icon
and android:id="@android:id/text1"
, then the library will take care the rest.
Here's an example:
. custom_tab_item.xml
. main.xml
Hope this help.