Tôi đã tạo một ứng dụng có trang cần tải nội dung động từ dịch vụ web. Tôi muốn có listview có thể di chuyển cùng với một layout tuyến tính bên trong NestedScrollView. Nhưng khi nội dung được tải vào listview, nó không trầy xước đến chiều cao đầy đủ của nó.Làm cách nào để có một ListView bên trong NestedScrollView
Đây là mã của tôi.
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.myquestionth.myquestionth10.Profile2Activity"
tools:showIn="@layout/activity_profile2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#BBBBBB" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Media heading"
android:id="@+id/textView2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis."
android:id="@+id/textView8" />
</LinearLayout>
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#70bcf5" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Tôi có một số tìm kiếm về chế độ xem cuộn không thể lồng nhau. Đây là ví dụ tôi muốn theo thiết kế bố cục của tôi từ trang đánh giá của Google Play. Phương pháp họ sử dụng là gì? Đề nghị tôi nếu tôi làm điều gì sai. Cảm ơn nhiều.
Đây là những gì tôi muốn.
sửa chiều cao của chế độ xem danh sách.hoặc cách tốt nhất là sử dụng coordinatorlayout và recyclerview.Refer [this] (http://inthecheesefactory.com/blog/android-design-support-library-codelab/en) –