完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/TabHost.html
TabHost
public class TabHost
extends FrameLayout
implements ViewTreeObserver.OnTouchModeChangeListener
java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.FrameLayout | |||
↳ | android.widget.TabHost |
Container 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 | TabHost.OnTabChangeListener Interface definition for a callback to be invoked when tab changed |
interface | TabHost.TabContentFactory Makes the content of a tab when it is selected. |
class | TabHost.TabSpec A tab has a tab indicator, content, and a tag that is used to keep track of it. |
继承XML属性 | |
---|---|
![]() android.widget.FrameLayout
| |
![]() android.view.ViewGroup
| |
![]() android.view.View
|
继承常量 |
---|
![]() android.view.ViewGroup
|
![]() android.view.View
|
继承字段 |
---|
![]() android.view.View
|
Public构造方法 | |
---|---|
TabHost(Context context) | |
TabHost(Context context, AttributeSet attrs) | |
TabHost(Context context, AttributeSet attrs, int defStyleAttr) | |
TabHost(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) |
Public方法 | |
---|---|
void | addTab(TabHost.TabSpec tabSpec) Add a tab. |
void | clearAllTabs() Removes all tabs from the tab widget associated with this tab host. |
boolean | dispatchKeyEvent(KeyEvent event) Dispatch a key event to the next view on the focus path. |
void | dispatchWindowFocusChanged(boolean hasFocus) Called when the window containing this view gains or loses window focus. |
CharSequence | getAccessibilityClassName() Return the class name of this object to be used for accessibility purposes. |
int | getCurrentTab() Returns the current tab. |
String | getCurrentTabTag() Returns the tag for the current tab. |
View | getCurrentTabView() Returns the view for the current tab. |
View | getCurrentView() |
FrameLayout | getTabContentView() Get the FrameLayout which holds tab content |
TabWidget | getTabWidget() |
TabHost.TabSpec | newTabSpec(String tag) Creates a new |
void | onTouchModeChanged(boolean isInTouchMode) Callback method to be invoked when the touch mode changes. |
void | setCurrentTab(int index) |
void | setCurrentTabByTag(String tag) Sets the current tab based on its tag. |
void | setOnTabChangedListener(TabHost.OnTabChangeListener l) Register a callback to be invoked when the selected state of any of the items in this list changes |
void | setup() Call setup() before adding tabs if loading TabHost using findViewById(). |
void | setup(LocalActivityManager activityGroup) If you are using |
继承方法
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/TabHost.html