я реализую NonSwipeableViewPager с фрагментом имеет NestedScrollView так, что я ожидаю, что Scrollview может перемещаться вверх и показать 2 TextViews:NestedScrollView не может прокручивать с match_parent высоты ребенка
<?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>
Но он не мог прокручивать, Я перепробовал много способов, но до сих пор не получил какого-либо решения
ScrollView нужна высота их ребенка быть wrap_content –
@TimCastelijns поэтому у нас нет никаких способов сделать это с высоты match_parent, не так ли? –
Вот как работает прокрутка, вы можете установить прокрутку в соответствии с родительским, но не дочерним элементом прокрутки, который должен быть обернут содержимым –