Skip to content

Most visited

Recently visited

navigation

TabItem

public final class TabItem
extends View

java.lang.Object
   ↳ android.view.View
     ↳ android.support.design.widget.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

android:icon Icon to display in the tab. 
android:layout A reference to a layout resource to be displayed in the tab. 
android:text Text to display in the tab. 

Inherited XML attributes

From class android.view.View

Inherited constants

From class android.view.View

Inherited fields

From class android.view.View

Public constructors

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

Inherited methods

From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

XML attributes

android:icon

Icon to display in the tab.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

android:layout

A reference to a layout resource to be displayed in the tab.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

android:text

Text to display in the tab.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Public constructors

TabItem

added in version 23.2.0
TabItem (Context context)

Parameters
context Context

TabItem

added in version 23.2.0
TabItem (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.