TabHost

14.03.06

TabHost

1、創建類繼承TabActivity


2、得到TabHost對象

getTabHost()

.NewTabSpc();--------->設置Tab

tabhost.addTab(tabspc);----->添加


TabHost tabhost=getTabHost();
                                            
        TabSpec tabSpec1=tabhost.newTabSpec("tag1");
        tabSpec1.setIndicator("聊天");
        tabSpec1.setContent(new Intent(MainActivity.this,FirstTabActivity.class));
        tabhost.addTab(tabSpec1);


   3、將tab佈局移動到底部的方法

       

       Height=0dp

      Weight=1//隨意

      <TabWidget></TabWidget>置於<FrameLayout></FrameLayout>之後


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章