public class TabHost extends FrameLayout implements ViewTreeObserver.OnTouchModeChangeListener
java.lang.Object ↳android.view.View ↳android.view.ViewGroup ↳android.widget.FrameLayout ↳android.widget.TabHost 已知的直接子类 FragmentTabHostContainer for a tabbed window view. This object holds two children: a set of tab labels that the user clicks to select a specific tab, and a FrameLayout object that displays the contents of that page. The individual elements are typically controlled using this container object, rather than setting values on the child elements themselves. 一个选项卡窗口视图的容器。此对象包含2个子项:用户点击选择的一组选项卡标签,和一个FrameLayout对象,其显示了页面的内容。各个的元素通常使用这个容器对象来控制,而不是在子元素本身上设置值。
Interface definition for a callback to be invoked when tab changed 回调接口定义,其在选项卡改变时调用的的
interfaceTabHost.TabContentFactoryMakes the content of a tab when it is selected. 当选项卡被选择时,产生它的内容。
classTabHost.TabSpecA tab has a tab indicator, content, and a tag that is used to keep track of it. 选项卡有一个选项卡指示器,内容和一个用来跟踪它的标签。
Add a tab. 添加一个选项卡。
voidclearAllTabs()Removes all tabs from the tab widget associated with this tab host. 从与此TabHost相关联的选项卡控件中移除所有的选项卡。
booleandispatchKeyEvent(KeyEvent event)Dispatch a key event to the next view on the focus path. 向焦点路径上的下一个视图派发一个KeyEvent。
voiddispatchWindowFocusChanged(boolean hasFocus)Called when the window containing this view gains or loses window focus. 当包含此视图的窗口获得或失去焦点时调用。
CharSequencegetAccessibilityClassName()Return the class name of this object to be used for accessibility purposes. 返回此对象的类名,用于辅助功能目的。
intgetCurrentTab()Returns the current tab. 返回当前的选项卡。
StringgetCurrentTabTag()Returns the tag for the current tab. 返回当前选项卡的标签。
ViewgetCurrentTabView()Returns the view for the current tab. 返回当前选项卡的视图。
ViewgetCurrentView() FrameLayoutgetTabContentView()Get the FrameLayout which holds tab content 获取包含选项卡内容的FrameLayout
TabWidgetgetTabWidget() TabHost.TabSpecnewTabSpec(String tag)Creates a new TabHost.TabSpec associated with this tab host. 创建一个与此TabHost相关联的一个新的TabHost.TabSpec。
voidonTouchModeChanged(boolean isInTouchMode)Callback method to be invoked when the touch mode changes. 回调方法,当触摸模式改变时调用。
voidsetCurrentTab(int index) voidsetCurrentTabByTag(String tag)Sets the current tab based on its tag. 设置这个标签的选项卡为当前选项卡。
voidsetOnTabChangedListener(TabHost.OnTabChangeListener l)Register a callback to be invoked when the selected state of any of the items in this list changes 注册一个回调,当此列表中的任何项的选择状态发生改变时调用。
voidsetup()Call setup() before adding tabs if loading TabHost using findViewById(). 如果使用findViewById()来加载TabHost,则在添加选项卡之前,首先调用setup()。
voidsetup(LocalActivityManager activityGroup)If you are using setContent(android.content.Intent), this must be called since the activityGroup is needed to launch the local activity. 如果你使用setContent(android.content.Intent),则必须调用此方法,因为activityGroup需要启动局部activity。
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/TabHost.html
