【发布时间】:2017-03-29 05:35:00
【问题描述】:
如何将水平滚动视图置于列表视图下方?我有一个列表视图,下面是一个带有一堆单选按钮的水平滚动视图。这是我的代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" 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"
android:layout_above="@+id/radioGroup">
</ListView>
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@null"
android:checked="true"
android:gravity="center"
android:padding="5dp"
android:text="/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:padding="5dp"
android:text="A-"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:padding="5dp"
android:text="B+"/>
<RadioButton
android:id="@+id/bNegative"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:padding="5dp"
android:text="/>
</RadioGroup>
</RelativeLayout>
我需要能够正常滚动列表视图,即垂直滚动视图和水平滚动视图。现在我无法滚动列表视图,但可以滚动水平滚动视图。请帮帮我
【问题讨论】:
-
您可以使用Recyclerview,它可以提供各种布局模式,如网格、垂直、水平、交错等。
标签: android listview horizontalscrollview