Recently google added android.support.design.widget.TabItem
in supportDesign
as documentation said:
TabItem is a special 'view' which allows you to declare tab items for a TabLayout within a layout. This view is not actually added to TabLayout, it is just a dummy which allows setting of a tab items's text, icon and custom layout.
But when I add TabItems
to my TabLayout
:
<android.support.design.widget.TabLayout
android:layout_height="wrap_content"
android:layout_width="match_parent">
<android.support.design.widget.TabItem
android:text="@string/tab_text"/>
<android.support.design.widget.TabItem
android:icon="@drawable/ic_android"/>
</android.support.design.widget.TabLayout>
Nothing displayed (in fact place of Tabs exist but Icon/Text not). Does any one knows How to use TabItem
through xml?