在底部滚动Tabhost [英] Scrolling Tabhost at the bottom

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

问题描述

我用tabhost教程开始使用Tabhost控制。

I used the tabhost tutorial to get started with the Tabhost control.

在周围的一些比赛我想使tabhost滚动,我想通了。

After some play around I wanted to make the tabhost scrollable, which I figured out.

现在我想在这只是不为我工作的显示器底部的tabhost。

Now I want the tabhost at the bottom of the display which is just not working for me.

切换到是在这里建议相对布局:的 iPhone类似的TabBar

Switched to Relative Layout which was suggested here: iPhone-like Tabbar

我的code:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:scrollbars="horizontal" android:isScrollContainer="true">
<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" android:layout_alignParentBottom="true">
    <RelativeLayout android:layout_height="fill_parent"
        android:layout_width="fill_parent">
        <HorizontalScrollView android:layout_width="fill_parent"
            android:layout_height="fill_parent" android:scrollbars="none"
            android:layout_alignParentBottom="true">
            <TabWidget android:id="@android:id/tabs"
                android:layout_alignParentBottom="true" android:layout_width="fill_parent"
                android:layout_height="wrap_content" />
        </HorizontalScrollView>
        <FrameLayout android:id="@android:id/tabcontent"
            android:layout_width="fill_parent" android:layout_height="fill_parent"
            android:padding="2dp" />
    </RelativeLayout>
</TabHost>

我需要一个提示,为什么它不工作/这将如何工作。我试着用相对布局和 layout_alignParentBottom =真正的现在是有几次(在Horizo​​ntalScrollView和TabWidget)

I need a hint why it's not working / how this would work. I tried with relative layout and layout_alignParentBottom="true" now it's there a few times (in the HorizontalScrollView and the TabWidget)

推荐答案

由于艾云导致我自定义控件我发现了一个有前途的项目:

Thanks to Arve leading me to "custom controls" I found a promising project:

https://github.com/honcheng/ScrollableTabHost-for-Android

我希望一些人在寻找这种tabhost可以使用它:)

I hope some others looking for this kind of tabhost can use it :)

这篇关于在底部滚动Tabhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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