【发布时间】:2018-05-25 08:02:45
【问题描述】:
我有一个看起来像这样的线性布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linear_layout"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
tools:context=".activities.EnrolStudentFormActivity">
<include
layout="@layout/app_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true" />
<ListView
android:id="@+id/list_view
android:layout_width="match_pare
android:layout_height="wrap_cont
android:divider="@null"
android:dividerHeight="0dp" />
</LinearLayout>
中间有几个ImageViews、TextInputLayouts 和TextInputEditTexts。我想让这个布局可滚动。我尝试使用ScrollView 和NestedScrollView 使其可滚动,但它们都将ListView 弄乱了。
我也在动态更改ListView 的内容,我在TextInputLayouts 里面有几个TextInputEditTexts 在ListView 里面。调整ListView 的大小并没有多大帮助,我无法单击ListView 内的TextInputEditText。 ScrollView 似乎捕获了触摸输入。
是否有任何变通方法可以让我在ScrollView 中使用ListView,或者使线性布局可滚动,同时使ListView 中的TextInputEditText 可用?
【问题讨论】:
-
你能添加你的设计问题吗?
标签: java android listview scrollview android-linearlayout