看不到,一般都是写好XML文件,然后通过LayoutInflater填充

解决方案 »

  1.   

    记得是这样的:
    按照android源码里面的tab_content.xml写一个layout,修改TabWidget的高度
    在你的TabActivity的oncreate方法里面setContentView(R.layout.xxxxx)
    ok
    tab_content.xml内容:
    <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost"
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <LinearLayout android:orientation="vertical"
         android:layout_width="fill_parent" android:layout_height="fill_parent">
            <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent"
             android:layout_height="wrap_content" android:layout_weight="0" />
            <FrameLayout android:id="@android:id/tabcontent"
             android:layout_width="fill_parent" android:layout_height="0dip"
                android:layout_weight="1"/>
    </LinearLayout>
    </TabHost>
      

  2.   

    为什么要设置高度呢,我认为美化可以加点图片就行。而且最主要的是,我在真机上调试的时候发现他那个选项卡不是很高,也就是说没有模拟器上那么丑。你非要设置高度的话,据说可以通过什么方法隐藏一部分,可能是调一下它与TOP的距离吧。我以前也做过这个,不过不记得了。嘿嘿...