Listview在ScrollView内部不起作用 [英] Listview not working inside ScrollView

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

问题描述

我已经在scrollview中创建了一个listview,该列表已经开始滚动,但是listview下面的linearlayout没有出现在屏幕上.已使用自定义适配器填充列表.下面是我的代码,请任何人帮助我.

I have created a listview inside scrollview, the list have started scrolling but linearlayout below listview does not appears on screen. have used custom adapter to fill list. Below is my code, please any body help me.

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#fff"
    android:fillViewport="true"
    >

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#fff"
        tools:context=".Crew">


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:padding="16dp"
                >

                <ListView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/crew_list"
                    android:layout_marginTop="20dp"
                    ></ListView>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_alignParentBottom="true"
                    android:layout_gravity="bottom"
                    >
                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="MESSAGE"
                        android:fontFamily="Myriad Pro"
                        android:textSize="15dp"
                        android:textColor="#d0d0d0"
                        android:padding="5dp"
                        />

                    <EditText
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:inputType="textMultiLine"
                        android:textSize="15dp"
                        android:padding="10dp"
                        android:text=""
                        android:gravity="top|left"
                        android:background="@drawable/textarealayout"
                        android:id="@+id/report_cabin_crew"
                        android:lines="3"/>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal">

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:src="@drawable/greybox"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="SEND SMS"
                            android:layout_marginLeft="5dp"
                            android:textColor="#0a3e8d"
                            />

                    </LinearLayout>

                    <Button
                        android:layout_width="match_parent"
                        android:layout_marginTop="8dp"
                        android:layout_height="wrap_content"
                        android:text="SEND MESSAGE"
                        android:textColor="#fff"
                        android:textSize="18dp"
                        android:background="@drawable/buttonlayout"
                        />
                </LinearLayout>


            </LinearLayout>

        </LinearLayout>


    </RelativeLayout>


</ScrollView>

推荐答案

您不必在彼此内部滚动布局.当组织布局时,您会意识到可以实现相同的行为并使用其中之一进行外观.

You cant have to scrolling layouts inside each other. When organize your layout you would realized that you can achieve the same behavior and look with one of them.

这篇关于Listview在ScrollView内部不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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