在tabhost如何摆脱横向滚动条? [英] How to get rid of horizontal scroll bar in tabhost?

查看:136
本文介绍了在tabhost如何摆脱横向滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想摆脱在TabHost水平滚动条。它的存在,即使TabWidget在上面。

下面是我的XML布局。

 < XML版本=1.0编码=UTF-8&GT?;
< TabHost的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
机器人:ID =@机器人:ID / tabhost
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT>
    <的FrameLayout
        机器人:ID =@机器人:ID / tabcontent
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =FILL_PARENT/>

    < TabWidget
        机器人:ID =@机器人:ID /标签
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =FILL_PARENT
        机器人:重力=底部/>
< / TabHost>
 

解决方案

巢它变成一个LinearLayout中

 < LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:方向=垂直
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT

    机器人:重力=center_horizo​​ntal>
   < TabHost
    机器人:ID =@机器人:ID / tabhost
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT
    >
...
...
...
    < / TabHost>
    < / LinearLayout中>
 

I want to get rid of horizontal scroll bar in TabHost. It's there even if TabWidget is on top.

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>

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆