TabHost.TabSpec

译者署名: madgoat

译者链接:http://madgoat.cn

翻译时间:2010-11-25

版本:Android 2.3 r1

 

结构

继承关系

public class TabHost.TabSpec extends Object

        

java.lang.Object

android.widget.TabHost.TabSpec

 

类概述

每个选项卡都有一个选项卡指示符,内容和tag标签用于跟踪。这种生成器可以帮助从这些选项中做出选择。针对选项卡的指示符,你可以选择:

    1)设置一个标题

    2)设置一个标题和图标

针对选项卡的内容,你可以选择:

1)视图的ID

2)TabHost.TabContentFactory创建的视图内容

3)加载ActivityIntent对象

 

公共方法

public String getTag ()

(译者注:获取tag标签字符串)

 

public TabHost.TabSpec setContent (int viewId)

为选项卡的内容指定视图的ID

(译注:即设定选项卡内容的视图)

 

public TabHost.TabSpec setContent (Intent intent)

指定一个加载activityIntent对象作为选项卡内容

 

public TabHost.TabSpec setContent (TabHost.TabContentFactory contentFactory)

指定一个TabHost.TabContentFactory用于创建选项卡的内容

 

public TabHost.TabSpec setIndicator (CharSequence label)

指定一个标签作为选项卡指示符

 

public TabHost.TabSpec setIndicator (View view)

指定一个视图作为选项卡指示符

 

public TabHost.TabSpec setIndicator (CharSequence label, Drawable icon)

为选项卡指示符指定一个标签和图标

 

补充

文章链接

TabHost中的TabSpec的标题能不能缩小啊?

androidTabActivity