TabWidget高度 [英] TabWidget Height

查看:173
本文介绍了TabWidget高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能设置TabWidget高度,有标签标注调整?

Is it possible to set the TabWidget height and have the tab labels adjust?

如果我设置TabWidget高度太小,则标签从视图中隐藏。

If I set the TabWidget height too small, then the labels are hidden from view.

<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"
            android:padding="5dp">
            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="30px" />
            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:padding="5dp" />
    </LinearLayout>
</TabHost>

感谢

推荐答案

的Andr​​oid 1.6增加了一个 setIndicator()方法对则tabspec 接受一个查看。我还没有尝试过,但我的理解是,它会给你更大的控制权的标签。

Android 1.6 added a setIndicator() method on TabSpec that accepts a View. I have not tried it yet, but my understanding is that it will give you greater control over the tabs.

这篇关于TabWidget高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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