java.lang.Object | |
↳ | android.support.design.widget.TabLayout.Tab |
A tab in this layout. Instances can be created via newTab()
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | INVALID_POSITION | An invalid position for a tab. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets a brief description of this tab's content for use in accessibility support.
| |||||||||||
Returns the custom view used for this tab.
| |||||||||||
Return the icon associated with this tab.
| |||||||||||
Return the current position of this tab in the action bar.
| |||||||||||
Return the text of this tab.
| |||||||||||
Returns true if this tab is currently selected.
| |||||||||||
Select this tab.
| |||||||||||
Set a description of this tab's content for use in accessibility support.
| |||||||||||
Set a description of this tab's content for use in accessibility support.
| |||||||||||
Set a custom view to be used for this tab.
| |||||||||||
Set a custom view to be used for this tab.
| |||||||||||
Set the icon displayed on this tab.
| |||||||||||
Set the icon displayed on this tab.
| |||||||||||
Give this Tab an arbitrary object to hold for later use.
| |||||||||||
Set the text displayed on this tab.
| |||||||||||
Set the text displayed on this tab.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Gets a brief description of this tab's content for use in accessibility support.
Return the current position of this tab in the action bar.
INVALID_POSITION
if this tab is not currently in
the action bar.
Returns true if this tab is currently selected.
Select this tab. Only valid if the tab has been added to the action bar.
Set a description of this tab's content for use in accessibility support. If no content description is provided the title will be used.
resId | A resource ID referring to the description text |
---|
Set a description of this tab's content for use in accessibility support. If no content description is provided the title will be used.
contentDesc | Description of this tab's content |
---|
Set a custom view to be used for this tab.
If the inflated layout contains a TextView
with an ID of
text1
then that will be updated with the value given
to setText(CharSequence)
. Similarly, if this layout contains an
ImageView
with ID icon
then it will be updated with
the value given to setIcon(Drawable)
.
layoutResId | A layout resource to inflate and use as a custom tab view |
---|
Set a custom view to be used for this tab.
If the provided view contains a TextView
with an ID of
text1
then that will be updated with the value given
to setText(CharSequence)
. Similarly, if this layout contains an
ImageView
with ID icon
then it will be updated with
the value given to setIcon(Drawable)
.
view | Custom view to be used as a tab. |
---|
Set the icon displayed on this tab.
icon | The drawable to use as an icon |
---|
Set the icon displayed on this tab.
resId | A resource ID referring to the icon that should be displayed |
---|
Give this Tab an arbitrary object to hold for later use.
tag | Object to store |
---|
Set the text displayed on this tab. Text may be truncated if there is not room to display the entire string.
resId | A resource ID referring to the text that should be displayed |
---|
Set the text displayed on this tab. Text may be truncated if there is not room to display the entire string.
text | The text to display |
---|