public static abstract class ActionBar.Tab
extends Object
| java.lang.Object | |
| android.support.v7.app.ActionBar.Tab | |
这个类已被弃用。
内置工具栏操作栏不支持操作栏导航模式。 考虑改用其他common navigation patterns 。
操作栏中的选项卡。
标签管理隐藏和显示 Fragment s。
常量(Constants) |
|
|---|---|
int |
INVALID_POSITION 选项卡无效的位置。 |
Public constructors |
|
|---|---|
ActionBar.Tab() |
|
公共方法(Public methods) |
|
|---|---|
abstract CharSequence |
getContentDescription() 获取此选项卡的内容的简要说明以用于辅助功能支持。 |
abstract View |
getCustomView() 为此选项卡检索先前设置的自定义视图。 |
abstract Drawable |
getIcon() 返回与此选项卡关联的图标。 |
abstract int |
getPosition() 在操作栏中返回此选项卡的当前位置。 |
abstract Object |
getTag() |
abstract CharSequence |
getText() 返回此选项卡的文本。 |
abstract void |
select() 选择此选项卡。 |
abstract ActionBar.Tab |
setContentDescription(int resId) 设置此选项卡内容的说明以用于辅助功能支持。 |
abstract ActionBar.Tab |
setContentDescription(CharSequence contentDesc) 设置此选项卡内容的说明以用于辅助功能支持。 |
abstract ActionBar.Tab |
setCustomView(int layoutResId) 设置用于此选项卡的自定义视图。 |
abstract ActionBar.Tab |
setCustomView(View view) 设置用于此选项卡的自定义视图。 |
abstract ActionBar.Tab |
setIcon(Drawable icon) 设置此选项卡上显示的图标。 |
abstract ActionBar.Tab |
setIcon(int resId) 设置此选项卡上显示的图标。 |
abstract ActionBar.Tab |
setTabListener(ActionBar.TabListener listener) 设置将处理切换到此选项卡的 |
abstract ActionBar.Tab |
setTag(Object obj) 给这个选项卡一个任意的对象以备后用。 |
abstract ActionBar.Tab |
setText(int resId) 设置此选项卡上显示的文字。 |
abstract ActionBar.Tab |
setText(CharSequence text) 设置此选项卡上显示的文字。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
ActionBar.Tab ()
CharSequence getContentDescription ()
获取此选项卡的内容的简要说明以用于辅助功能支持。
| 返回(Returns) | |
|---|---|
CharSequence |
Description of this tab's content |
View getCustomView ()
为此选项卡检索先前设置的自定义视图。
| 返回(Returns) | |
|---|---|
View |
The custom view set by setCustomView(View). |
int getPosition ()
在操作栏中返回此选项卡的当前位置。
| 返回(Returns) | |
|---|---|
int |
Current position, or INVALID_POSITION if this tab is not currently in the action bar. |
void select ()
选择此选项卡。 仅当选项卡已添加到操作栏时才有效。
ActionBar.Tab setContentDescription (int resId)
设置此选项卡内容的说明以用于辅助功能支持。 如果没有提供内容描述,则将使用标题。
| 参数(Parameters) | |
|---|---|
resId |
int: A resource ID referring to the description text |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
ActionBar.Tab setContentDescription (CharSequence contentDesc)
设置此选项卡内容的说明以用于辅助功能支持。 如果没有提供内容描述,则将使用标题。
| 参数(Parameters) | |
|---|---|
contentDesc |
CharSequence: Description of this tab's content |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
ActionBar.Tab setCustomView (int layoutResId)
设置用于此选项卡的自定义视图。 这覆盖由setText(CharSequence)和setIcon(Drawable)设置的值。
| 参数(Parameters) | |
|---|---|
layoutResId |
int: A layout resource to inflate and use as a custom tab view |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
ActionBar.Tab setCustomView (View view)
设置用于此选项卡的自定义视图。 这覆盖由setText(CharSequence)和setIcon(Drawable)设置的值。
| 参数(Parameters) | |
|---|---|
view |
View: Custom view to be used as a tab. |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
ActionBar.Tab setIcon (Drawable icon)
设置此选项卡上显示的图标。
| 参数(Parameters) | |
|---|---|
icon |
Drawable: The drawable to use as an icon |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
ActionBar.Tab setIcon (int resId)
设置此选项卡上显示的图标。
| 参数(Parameters) | |
|---|---|
resId |
int: Resource ID referring to the drawable to use as an icon |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
ActionBar.Tab setTabListener (ActionBar.TabListener listener)
设置将处理切换到此选项卡的ActionBar.TabListener 。 在添加到ActionBar之前,所有选项卡必须设置TabListener。
| 参数(Parameters) | |
|---|---|
listener |
ActionBar.TabListener: Listener to handle tab selection events |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
ActionBar.Tab setTag (Object obj)
给这个选项卡一个任意的对象以备后用。
| 参数(Parameters) | |
|---|---|
obj |
Object: Object to store |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
ActionBar.Tab setText (int resId)
设置此选项卡上显示的文字。 如果没有空间显示整个字符串,文本可能会被截断。
| 参数(Parameters) | |
|---|---|
resId |
int: A resource ID referring to the text that should be displayed |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
ActionBar.Tab setText (CharSequence text)
设置此选项卡上显示的文字。 如果没有空间显示整个字符串,文本可能会被截断。
| 参数(Parameters) | |
|---|---|
text |
CharSequence: The text to display |
| 返回(Returns) | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |