开发者

Lablayout and Linairlayout

I am trying to make a app 开发者_运维百科with the tutorial of the developers page, then I would like to display a main.xml in a tabview, instead the textview, which in the tutorial, is in the activity.

How do I tell my tab in activity do display the main.xml?


Set up your tabhost to have an activity in the tab, and then in that activity set its content view to your main.xml:

tabhost activity

TabHost host = getTabHost(); 
Intent tab1 = new Intent(this, main.class);
host.addTab(host.newTabSpec("one").setIndicator("Tab 1").setContent(tab1));

main.class

setContentView(setContentView(R.layout.main);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜