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
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属性
android.widget.LinearLayout
android.view.ViewGroup
android.view.View
继承常量
android.widget.LinearLayout
android.view.ViewGroup
android.view.View
继承字段
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方法
void
addView(View child)
Adds a child view.
添加一个子视图。
void
childDrawableStateChanged(View child)
If addStatesFromChildren()
is true, refreshes this group's drawable state (to include the states from its children).
如果addStatesFromChildren()
为true,刷新此组的drawable状态 (包括其子项的状态)。
void
dispatchDraw(Canvas canvas)
Called by draw to draw the child views.
通过draw()调用,来绘制子视图。
void
focusCurrentTab(int index)
Sets the current tab and focuses the UI on it.
设置当前的选项卡,并把在焦点UI设置在上面。
CharSequence
getAccessibilityClassName()
Return the class name of this object to be used for accessibility purposes.
返回此对象的类名,用于辅助功能目的。
View
getChildTabViewAt(int index)
Returns the tab indicator view at the given index.
返回指定索引的选项卡指示器的视图。
Drawable
getLeftStripDrawable()
Drawable
getRightStripDrawable()
int
getTabCount()
Returns the number of tab indicator views.
返回选项卡指示器视图的数量。
boolean
isStripEnabled()
Indicates whether the bottom strips on the tab indicators are drawn or not.
是否绘制选项卡指示器的底部条状图形。
void
onFocusChange(View v, boolean hasFocus)
Called when the focus state of a view has changed.
当视图的焦点状态发生改变时调用。
PointerIcon
onResolvePointerIcon(MotionEvent event, int pointerIndex)
Returns the pointer icon for the motion event, or null if it doesn't specify the icon.
返回MotionEvent的指针图标,如果没有指定图标,则为null。
void
removeAllViews()
Call this method to remove all child views from the ViewGroup.
调用此方法,从ViewGroup中移除所有的子视图。
void
setCurrentTab(int index)
Sets the current tab.
设置当前的选项卡。
void
setDividerDrawable(int resId)
Sets the drawable to use as a divider between the tab indicators.
设置用于选项卡指示器之间的分隔栏的drawable。
void
setDividerDrawable(Drawable drawable)
Sets the drawable to use as a divider between the tab indicators.
设置用于选项卡指示器之间的分隔栏的drawable。
void
setEnabled(boolean enabled)
Set the enabled state of this view.
设置此视图的使能状态。
void
setLeftStripDrawable(Drawable drawable)
Sets the drawable to use as the left part of the strip below the tab indicators.
设置用于位于选项卡指示器底部条状图形的左边部分的drawable。
void
setLeftStripDrawable(int resId)
Sets the drawable to use as the left part of the strip below the tab indicators.
设置用于位于选项卡指示器底部条状图形的左边部分的drawable。
void
setRightStripDrawable(int resId)
Sets the drawable to use as the right part of the strip below the tab indicators.
设置用于位于选项卡指示器底部条状图形的右边部分的drawable。
void
setRightStripDrawable(Drawable drawable)
Sets the drawable to use as the right part of the strip below the tab indicators.
设置用于位于选项卡指示器底部条状图形的右边部分的drawable。
void
setStripEnabled(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- Android7.0中文API -- TabWidget
- Android7.0中文API---ImageButton
- Android7.0 中文API -- ZoomButton
- Android7.0中文API --- ImageView
- Android7.0中文API -- ListView
- android7.0中文API -- LinearLayout
- Android7.0中文API -- TableLayout
- Android7.0中文API -- TableRow
- Android7.0中文API -- ZoomControls
- Android7.0中文API -- ActionMenuView
- Android7.0中文API -- RadioGroup
- Android7.0中文API -- SearchView
- Android7.0中文API -- SeekBar
- Android7.0中文API -- ProgressBar
- Android7.0中文API --- AbsSeekBar
- Android7.0中文API -- RatingBar
- Android7.0中文API -- Spinner
- Android7.0中文API -- AbsSpinner
- 在ubuntu16.04.2安装jdk7
- 物体检测(1)--R-CNN物体检测
- dubbo xsd关联
- 1038. 统计同成绩学生(20)
- Bootstrap文件上传组件:Bootstrap fileinput
- Android7.0中文API -- TabWidget
- 物联网浪潮之下,前端工程师如何迎刃而上?
- webpack和webpack-simple中如何引入css文件
- @1x @2x和@3x.png 的区别
- ViewPager系列之 仿魅族应用的广告BannerView
- Weak Pointer
- 大话设计模式阅读笔记-外观模式
- 有序广播与无序广播案例
- Linux扩大虚拟机系统磁盘空间