Preface
This chapter is about android. widget. TabHost. TabSpec. The version is Android 2.3 r1 and translated from "madgoat". You are welcome to visit his blog: http://madgoat.cn/. Thank you again "madgoat "! I look forward to you join the Android Chinese translation group, contact my over140@gmail.com.
Statement
You are welcome to repost, but please keep the original source of the article :)
Blog Garden: http://www.cnblogs.com/
Android Chinese translation group: http://code.taobao.org/project/view/404/
Body
I. Structure
Public class TabHost. TabSpec extends Object
Java. lang. Object
Android. widget. TabHost. TabSpec
Ii. Overview
Each option card has a tab indicator, and the content and tag label are used for tracking. This builder can help you select from these options. For the tab indicators, you can select:
1) set a title
2) set a title and icon
For the tab content, you can select:
1) view ID
2) View content created by TabHost. TabContentFactory
3) load the Intent object of the Activity
Iii. Public Methods
Public StringGetTag()
(Translator's note: Get the tag string)
Public TabHost. TabSpecSetContent(Int viewId)
Specify the view ID for the tab content
Set the view of the tab content)
Public TabHost. TabSpecSetContent(Intent intent)
Specifies an Intent object for loading the activity as the tab content
Public TabHost. TabSpecSetContent(TabHost. TabContentFactory contentFactory)
Specify a TabHost. TabContentFactory to create the content of the tab.
Public TabHost. TabSpecSetIndicator(CharSequence label)
Specify a label as a tab indicator
Public TabHost. TabSpecSetIndicator(View view)
Specify a view as a tab indicator
Public TabHost. TabSpecSetIndicator(CharSequence label, Drawable icon)
Specify a label and icon for the tab indicator
Iv. Supplement
Article Link
Can the title of TabSpec in TabHost be reduced?
TabActivity for android
V. related chapters
Android 2.3 r1 Chinese api (58) -- TabHost