Android7.0中文API -- TabWidget

来源:互联网 发布:京东剑客软件 编辑:程序博客网 时间:2024/05/16 04:38

完整内容请查看:http://www.zhdoc.net/android/reference/android/widget/TabWidget.html

TabWidget

public class TabWidget
extendsLinearLayout implements View.OnFocusChangeListener

java.lang.Object   ↳android.view.View    ↳android.view.ViewGroup     ↳android.widget.LinearLayout      ↳android.widget.TabWidget

Displays a list of tab labels representing each page in the parent's tab collection.
显示一个选项卡标签的列表,这些标签代表了父选项卡的每个页面。

The container object for this widget is TabHost. When the user selects a tab, this object sends a message to the parent container, TabHost, to tell it to switch the displayed page. You typically won't use many methods directly on this object. The container TabHost is used to add labels, add the callback handler, and manage callbacks. You might call this object to iterate the list of tabs, or to tweak the layout of the tab list, but most methods should be called on the containing TabHost object.
此widget的容器对象是TabHost。当用户选择了选项卡,此对象将发送一个消息到它的父容器TabHost中,以告诉它切换显示页面。你通常不需要在这个对象上调用很多方法。TabHost容器用于添加标签,回调处理方法,并管理回调。你可以调用这个对象来迭代选项卡的列表,或者调整选项卡的列表的布局,但是大多数方法应该在包含TabHost对象上调用。

摘要


XML属性

android:divider用于绘制选项卡间分隔栏的Drawable。 android:tabStripEnabled确定是否绘制选项卡指示器中的下划线。 android:tabStripLeft用来绘制选项卡下面的分割线左边部分的drawable。 android:tabStripRight用来绘制选项卡下面的分割线右边部分的drawable。 

继承XML属性

From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View

继承常量

From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View

继承字段

From class android.view.View

Public构造方法

TabWidget(Context context) TabWidget(Context context, AttributeSet attrs) TabWidget(Context context, AttributeSet attrs, int defStyleAttr) TabWidget(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public方法

voidaddView(View child)

Adds a child view.
添加一个子视图。

voidchildDrawableStateChanged(View child)

If addStatesFromChildren() is true, refreshes this group's drawable state (to include the states from its children).
如果addStatesFromChildren()为true,刷新此组的drawable状态 (包括其子项的状态)。

voiddispatchDraw(Canvas canvas)

Called by draw to draw the child views.
通过draw()调用,来绘制子视图。

voidfocusCurrentTab(int index)

Sets the current tab and focuses the UI on it.
设置当前的选项卡,并把在焦点UI设置在上面。

CharSequencegetAccessibilityClassName()

Return the class name of this object to be used for accessibility purposes.
返回此对象的类名,用于辅助功能目的。

ViewgetChildTabViewAt(int index)

Returns the tab indicator view at the given index.
返回指定索引的选项卡指示器的视图。

DrawablegetLeftStripDrawable()DrawablegetRightStripDrawable()intgetTabCount()

Returns the number of tab indicator views.
返回选项卡指示器视图的数量。

booleanisStripEnabled()

Indicates whether the bottom strips on the tab indicators are drawn or not.
是否绘制选项卡指示器的底部条状图形。

voidonFocusChange(View v, boolean hasFocus)

Called when the focus state of a view has changed.
当视图的焦点状态发生改变时调用。

PointerIcononResolvePointerIcon(MotionEvent event, int pointerIndex)

Returns the pointer icon for the motion event, or null if it doesn't specify the icon.
返回MotionEvent的指针图标,如果没有指定图标,则为null。

voidremoveAllViews()

Call this method to remove all child views from the ViewGroup.
调用此方法,从ViewGroup中移除所有的子视图。

voidsetCurrentTab(int index)

Sets the current tab.
设置当前的选项卡。

voidsetDividerDrawable(int resId)

Sets the drawable to use as a divider between the tab indicators.
设置用于选项卡指示器之间的分隔栏的drawable。

voidsetDividerDrawable(Drawable drawable)

Sets the drawable to use as a divider between the tab indicators.
设置用于选项卡指示器之间的分隔栏的drawable。

voidsetEnabled(boolean enabled)

Set the enabled state of this view.
设置此视图的使能状态。

voidsetLeftStripDrawable(Drawable drawable)

Sets the drawable to use as the left part of the strip below the tab indicators.
设置用于位于选项卡指示器底部条状图形的左边部分的drawable。

voidsetLeftStripDrawable(int resId)

Sets the drawable to use as the left part of the strip below the tab indicators.
设置用于位于选项卡指示器底部条状图形的左边部分的drawable。

voidsetRightStripDrawable(int resId)

Sets the drawable to use as the right part of the strip below the tab indicators.
设置用于位于选项卡指示器底部条状图形的右边部分的drawable。

voidsetRightStripDrawable(Drawable drawable)

Sets the drawable to use as the right part of the strip below the tab indicators.
设置用于位于选项卡指示器底部条状图形的右边部分的drawable。

voidsetStripEnabled(boolean stripEnabled)

Controls whether the bottom strips on the tab indicators are drawn or not.
设置是否绘制选项卡指示器的底部条状图形。

保护方法

完整内容请查看:http://www.zhdoc.net/android/reference/android/widget/TabWidget.html
原创粉丝点击