RelativeLayout的内容不能被看见 [英] RelativeLayout content can not be seen

查看:162
本文介绍了RelativeLayout的内容不能被看见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像下面的布局显示,当列表中的项目太多了,超过一屏多。

Like the following layout shows, when the items in list are too much, more than one screen.

我看不到下面的LinearLayout内容时,我拖累。

I can not see the following LinearLayout content when I drag down.

如何解决这个问题呢?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ListView
        android:id="@+id/list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="wrap_content"
        android:layout_height="100dp"
        android:layout_below="@+id/list"
        android:layout_centerHorizontal="true"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/UserIDStatic"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/UserID" />
        .
        .
        .
    </LinearLayout>

</RelativeLayout>

在此先感谢!

推荐答案

改变这种

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ListView
        android:id="@+id/list"
        android:layout_width="match_parent"
        android:layout_height="100dp" >   <!-- use a definate dimension here -->
    </ListView>

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="wrap_content"
        android:layout_height="100dp"
        android:layout_below="@+id/list"
        android:layout_centerHorizontal="true"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/UserIDStatic"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/UserID" />
        .
        .
        .
    </LinearLayout>

</RelativeLayout>

要不然搁两者的ListView 的LinearLayout 滚动型

或波纹管注释

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
android:weightSum="1"
android:orientatio="verticle" >

        <ListView
            android:id="@+id/list"
           android:layout_weight="0.5"
            android:layout_width="match_parent"
            android:layout_height="0dp" >  
        </ListView>

        <LinearLayout
            android:id="@+id/linearLayout1"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
             android:layout_weight="0.5"


            android:orientation="horizontal" >

            <TextView
                android:id="@+id/UserIDStatic"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/UserID" />
            .
            .
            .
        </LinearLayout>

    </LinearLayout>

这篇关于RelativeLayout的内容不能被看见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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