如何摆脱tabhost中的水平滚动条? [英] How to get rid of horizontal scroll bar in tabhost?
本文介绍了如何摆脱tabhost中的水平滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想去掉 TabHost 中的水平滚动条.即使 TabWidget 位于顶部,它也在那里.
I want to get rid of horizontal scroll bar in TabHost. It's there even if TabWidget is on top.
下面是我的 xml 布局.
Below is my xml layout.
<?xml version="1.0" encoding="utf-8"?>
<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" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom" />
</TabHost>
推荐答案
将其嵌套到 Linearlayout 中
Nest it into a Linearlayout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal">
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
...
...
...
</TabHost>
</LinearLayout>
这篇关于如何摆脱tabhost中的水平滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文