J'essaie d'utiliser une feuille de fond avec un ListView à l'intérieur, mais je suis confronté à deux problèmes, 1er. le ListView n'occupe pas tout l'espace de la Bottom Sheet, le match-parent ne fonctionne pas, 2ème. faire défiler la liste ne fonctionne pas vraiment, si j'essaie de faire défiler vers le bas, il défile un peu au lieu d'un défilement normal et si je défile vers le haut, la feuille inférieure se referme au lieu de faire défiler la liste. Gif of the problemAndroid Bottom Sheet avec Listview ne fonctionne pas
Voici le XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.abili.agriexport2.MapsActivity" />
<android.support.v4.widget.NestedScrollView
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="350dp"
android:background="?android:attr/windowBackground"
android:clipToPadding="true"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:orientation="horizontal">
<TextView
android:id="@+id/textView11"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="16dp"
android:text="Direções"
android:textColor="@color/colorWhite"
android:textSize="24sp" />
<ImageButton
android:id="@+id/closeBottomSheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="5"
android:background="@null"
app:srcCompat="@drawable/mr_ic_close_dark" />
</LinearLayout>
<ListView
android:id="@+id/listaDirecoes"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
apprécierais toute aide :)
Bien que nº1 problème fixe, merci beaucoup, avez-vous une idée de fixer nº2 problème? – alb
@alb vérifier l'édition, j'espère que cela fonctionne! –
Nope n'a pas fonctionné – alb