ListView is not scrolling inside LinearLayout. Then I have added a ScrollView and put the LinearLayout that contains ListView. But still my code is not working. Here is my full xml code...
bottom_content_geofence_show.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/des_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
app:cardBackgroundColor="@color/cardview_dark_background">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="12dp"
android:paddingStart="20dp"
android:paddingTop="12dp">
<TextView
android:id="@+id/textView16"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Type of Geofence is Polygon"
android:textAllCaps="true" />
<TextView
android:id="@+id/created_by_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Created By Anuradha"
android:textAllCaps="true" />
<TextView
android:id="@+id/created_on_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="CReated On 4 April, 2017"
android:textAllCaps="true" />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/enforce_detail_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:paddingStart="20dp"
android:paddingTop="20dp"
app:cardBackgroundColor="@color/cardview_dark_background">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical">
<TextView
android:id="@+id/enforce_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Enforced Assets"
android:textAlignment="viewStart"
android:textAllCaps="true"
android:textColor="@color/colorPrimary"
android:textSize="14sp" />
<ListView
android:id="@+id/asset_list"
style="@style/Widget.AppCompat.ListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:divider="@color/White"
android:groupIndicator="@null"
android:overScrollMode="always"
android:smoothScrollbar="true" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
This layout will be shown inside a NestedScrollView
activity_show.xml
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include layout="@layout/bottom_content_geofence_show" />
</android.support.v4.widget.NestedScrollView>
Please let me know possible solutions. Thanks in advance.