| getTag() | ใช้คืนค่า tag ของ Object TabHost.TabSpec |
|---|---|
| setContent() | ใช้กำหนด id ของ Object View ที่ต้องการให้อยู่ภายใน Object TabSpec นี้ |
| setIndicator ( view ) | ใช้กำหนด Object View ที่จะแสดงอยู่บน หัวข้อของ TabSpec |
| setIndicator ( label ) | ใช้กำหนด คำอธิบาย ที่จะแสดงอยู่บน หัวข้อของ TabSpec |
method:getTag ( )
return type:String
content:ใช้คืนค่า tag ของ Object TabHost.TabSpec
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); TabHost tab_host = new TabHost ( this ); tab_host.setup(); TabHost.TabSpec tab_spec = tab_host.newTabSpec ( "tag_one" ); Button button = new Button ( this ); tab_spec.setContent ( button.getId ( ) ); tab_spec.setIndicator( "TestButton" ); tab_host.addTab ( tab_spec ); String tag = tab_spec.getTag ( ); setContentView ( tab_host ); } }
method:setContent ( int viewId )
return type:void
content:ใช้กำหนด id ของ Object View ที่ต้องการให้อยู่ภายใน Object TabSpec นี้
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); TabHost tab_host = new TabHost ( this ); tab_host.setup(); TabHost.TabSpec tab_spec = tab_host.newTabSpec ( "tag_one" ); Button button = new Button ( this ); tab_spec.setContent ( button.getId ( ) ); tab_spec.setIndicator( "TestButton" ); tab_host.addTab ( tab_spec ); String tag = tab_spec.getTag ( ); setContentView ( tab_host ); } }
method:setIndicator ( View view )
return type:void
content:ใช้กำหนด Object View ที่จะแสดงอยู่บน หัวข้อของ TabSpec
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); TabHost tab_host = new TabHost ( this ); tab_host.setup(); TabHost.TabSpec tab_spec = tab_host.newTabSpec ( "tag_one" ); Button button = new Button ( this ); tab_spec.setContent ( button.getId ( ) ); TextView text_view = new TextView ( this ); text_view.setText ( "TestButton" ); tab_spec.setIndicator( text_view ); tab_host.addTab ( tab_spec ); String tag = tab_spec.getTag ( ); setContentView ( tab_host ); } }
method:setIndicator ( CharSequence label )
return type:void
content:ใช้กำหนด คำอธิบาย ที่จะแสดงอยู่บน หัวข้อของ TabSpec
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); TabHost tab_host = new TabHost ( this ); tab_host.setup(); TabHost.TabSpec tab_spec = tab_host.newTabSpec ( "tag_one" ); Button button = new Button ( this ); tab_spec.setContent ( button.getId ( ) ); tab_spec.setIndicator( "TestButton" ); tab_host.addTab ( tab_spec ); String tag = tab_spec.getTag ( ); setContentView ( tab_host ); } }