Click here to Skip to main content
15,878,748 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I tried list and recycler view in both scroll/nestedscroll view, height of list is not expanding properly. If i hard code height of list than it works otherwise wrap content not working. I searched a lot on internet, due to listview in scroll view and both objects have scrolling abilities that is why one object dont let other to scroll. That is why height of listview is not working. I know its bad practice but i dont have a choice my layout contains several objects like checkbox and edittext. And i need to scroll other objects too.

XML
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
        xmlns-android="http-//schemas.android.com/apk/res/android"
        xmlns-app="http-//schemas.android.com/apk/res-auto"
        android-isScrollContainer="false"
        android-layout_width="match_parent"
        android-layout_height="match_parent"
        android-layout_gravity="fill_vertical"
        android-clipToPadding="false"
        app-layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android-layout_width="match_parent"
            android-layout_height="match_parent"
            android-orientation="vertical"
            android-paddingTop="1dp">

     <ListView
        android-id="@+id/list"
        android-layout_width="fill_parent"
        android-layout_height="match_parent"
        android-divider="@null" />
         </LinearLayout>
</android.support.v4.widget.NestedScrollView>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900