简体   繁体   中英

Listview not working inside ScrollView

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM