Привет У меня есть попытаться вставить ListView в Scrollview, но у меня есть эта проблема: Android ListView в Scrollview
пространство, Scrollview резерв ListView мало, я хочу, чтобы Scrollview является чем экран, я хочу Scrollview является видимо только тогда, когда listview становится больше, чем на экране. Как я это делаю?
это код:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_height="wrap_content"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:id="@+id/activity_lista__eventi"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="14dp"
android:paddingRight="14dp"
android:paddingTop="@dimen/activity_vertical_margin"
xmlns:android="http://schemas.android.com/apk/res/android"
tools:context="com.example.fra87.eudroid.activity_class.Lista_Eventi">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="vertical">
<SearchView
android:layout_width="match_parent"
android:layout_height="50dp"
android:queryHint="Evento"
android:id="@+id/cercaEvento"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:id="@+id/linearLayoutEventi">
<ListView
android:id="@+id/listViewEventi"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/cercaEvento"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Как я могу это сделать?
Try nestedscrollview вместо Scrollview – AbhayBohra
сделать вашу линейную высоту макета как wrape_content и посетить этот http://stackoverflow.com/questions/18367522/android -list-вид-в-а-свитка вид –