Android 12 Developer Preview is here! Try it out, and give us your feedback!

TabItem

public class TabItem
extends View

java.lang.Object
   ↳ android.view.View
     ↳ com.google.android.material.tabs.TabItem


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. See TabLayout for more information on how to use it.

See also:

Summary

XML attributes

TabItem_android_icon  
TabItem_android_layout  
TabItem_android_text  

Inherited constants

Fields

public final int customLayout

public final Drawable icon

public final CharSequence text

Inherited fields

Public constructors

TabItem(Context context)
TabItem(Context context, AttributeSet attrs)

Inherited methods

XML attributes

TabItem_android_icon

TabItem_android_layout

TabItem_android_text

Fields

customLayout

public final int customLayout

icon

public final Drawable icon

text

public final CharSequence text

Public constructors

TabItem

public TabItem (Context context)

Parameters
context Context

TabItem

public TabItem (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet