Android 选项卡具体代码编写方式介绍
2010-02-10 06:40:00 来源:WEB开发网核心提示:Activity需要继承TabActivityAndroid选项卡Java代码public class HelloTabWidget extends TabActivity public class HelloTabWidget extends TabActivityAndroid选项卡Java代码public v
Activity需要继承TabActivity
Android选项卡Java代码
- public class HelloTabWidget extends TabActivity
- public class HelloTabWidget extends TabActivity
Android选项卡Java代码
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- mTabHost = getTabHost();
- mTabHost.addTab(mTabHost.newTabSpec("tab_test1").
setIndicator("TAB 1").setContent(R.id.textview1));- mTabHost.addTab(mTabHost.newTabSpec("tab_test2").
setIndicator("TAB 2").setContent(R.id.textview2));- mTabHost.addTab(mTabHost.newTabSpec("tab_test3").
setIndicator("TAB 3").setContent(R.id.textview3));- mTabHost.setCurrentTab(0);
- }
Android选项卡的具体实现方式就为大家介绍到这里。
更多精彩
赞助商链接