[英]Listview not working inside ScrollView
我在scrollview中创建了一个listview,该列表已开始滚动,但listview下面的linearlayout没有出现在屏幕上。 已使用自定义适配器填充列表。 以下是我的代码,请任何人帮助我。
<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>
您不必在彼此内部滚动布局。 当组织布局时,您会意识到可以实现相同的行为并使用其中之一进行外观。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.