Android 如何从选项卡视图中删除图标空间
我需要删除TabHost中的图标空间以及文本和选项卡顶部之间的空间?我只想显示文本 这是我的activity_main.xmlAndroid 如何从选项卡视图中删除图标空间,android,android-tabhost,tabwidget,Android,Android Tabhost,Tabwidget,我需要删除TabHost中的图标空间以及文本和选项卡顶部之间的空间?我只想显示文本 这是我的activity_main.xml `<TabHost android:id="@android:id/tabhost" android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" > <LinearLayout
`<TabHost
android:id="@android:id/tabhost"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</TabWidget>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
</LinearLayout>
</TabHost>`
现在是这样。
但我需要把它转换成这样的东西。
提前感谢。可能使用:
android:layout_height="wrap_content"
在Tabhost、LinearLayout和FrameLayout中替换此选项
我认为父视图的高度更大,因此您的tabhost仅采用父视图的高度不起作用。它创建这个空间是因为android默认的TabHost布局。我需要把它取下来。
/**Tab All**/
intent=new Intent(this,tab_all.class);
spec=tabHost.newTabSpec("First").setIndicator((View)findViewById(R.id.tab_all)).setContent(intent);
tabHost.addTab(spec);
/**Tab Today**/
intent=new Intent(this,tab_today.class);
spec=tabHost.newTabSpec("Second").setIndicator((View)findViewById(R.id.tab_all)).setContent(intent);
tabHost.addTab(spec);
/**Tab This Month**/
intent=new Intent(this,tab_thismonth.class);
spec=tabHost.newTabSpec("Third").setIndicator((View)findViewById(R.id.tab_all)).setContent(intent);
tabHost.addTab(spec);
android:layout_height="wrap_content"