tôi thực hiện NonSwipeableViewPager với một mảnh có NestedScrollView như thế này, những gì tôi mong đợi là scrollview có thể cuộn lên và hiển thị 2 TextView:NestedScrollView không thể di chuyển với match_parent chiều cao con
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/header" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="16dp"
android:src="@drawable/ic_up" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text 1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text 2" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Nhưng nó không thể di chuyển, Tôi đã thử nhiều cách nhưng vẫn không nhận được bất kỳ giải pháp nào
ScrollView cần chiều cao của con mình là wrap_content –
@TimCastelijns vì vậy chúng tôi không có cách nào để làm điều đó với chiều cao match_parent, phải không? –
đó chỉ là cách scrollview hoạt động, bạn có thể thiết lập scrollview để phù hợp với cha mẹ, nhưng không phải là con của scrollview, mà cần phải được quấn nội dung –