如何设置滚动标签看法? [英] How do you set tab view to scroll?

查看:90
本文介绍了如何设置滚动标签看法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功地建立了一个标签查看我的应用程序(呜!)

I have managed to set up a tabbed view for my app (woo!)

和具有以下的xml为UI

and have the following xml for the UI

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<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="wrap_content" 
    />
    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    />
</LinearLayout>

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
    <Spinner android:id="@+id/areaSpinner"
             android:layout_width="fill_parent"
             android:layout_height="@dimen/one_row"
     />
     <Spinner android:id="@+id/cragSpinner"
              android:layout_width="fill_parent"
              android:layout_height="@dimen/one_row"
     />
     <Spinner android:id="@+id/routeSpinner"
              android:layout_width="fill_parent"
              android:layout_height="@dimen/one_row"
     />
     <DatePicker android:id="@+id/dateClimbed"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
     />
     <Spinner android:id="@+id/styleSpinner"
              android:layout_width="fill_parent"
              android:layout_height="@dimen/one_row"
     />
     <Spinner android:id="@+id/detailsSpinner"
              android:layout_width="fill_parent"
              android:layout_height="@dimen/one_row"
     />
     <TextView android:id="@+id/climbNotes"
             android:layout_width="fill_parent"
             android:layout_height="@dimen/three_row"
   />
</LinearLayout>

但我似乎无法向下滚动查看该表格的其余部分(切断在纺纱厂之一,这是为什么?怎么解决呢?

yet am seemingly unable to scroll down to see the rest of the form (cuts off at one of the spinners, why is this? and how do i fix it?

推荐答案

我有同样的问题!

我所做的是插入一个滚动型到第一个XML文件只是内部TabHost标签,就像这样:

What I did was insert a ScrollView into the first XML file just "inside" the TabHost tags, like so:

&LT; TabHost&GT;

&LT;滚动型机器人:layout_width =FILL_PARENT机器人:layout_height =FILL_PARENT&GT;

&LT;&的LinearLayout GT;

...你的东西,其余

... the rest of your stuff

&LT; / LinearLayout中&GT;

&LT; /滚动型&GT;

&LT; / TabHost&GT;

希望这有助于!

这篇关于如何设置滚动标签看法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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