У меня есть эта проблема, когда мой просмотрщик не выполняет вложенную прокрутку на API 19 (леденец) ... на последней версии Android все в порядке.используя следующую зависимость: com.android.support:design:26.1.0
и то, что я создал, - это просмотрщик, который должен иметь липкий заголовок.заголовок находится в просмотре карты, а элементы списка находятся под просмотром карты.это выглядит так:
detailscreen.xml:
<!--wrapping in RelativeLayout until this is resolved: https://stackoverflow.com/questions/57142959/why-latest-version-constraintlayout-doesnt-work-in-nestedscrollview-with-coordi-->
<RelativeLayout 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"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="@+id/headerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/ride_hail_meet_at"
android:textColor="#388bf2"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_weatherdata"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:focusable="false"
android:focusableInTouchMode="false"
android:nestedScrollingEnabled="false"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_description"
tools:itemCount="3"
tools:listitem="@layout/weather_data_row_item"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<RelativeLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/headerView"
android:layout_alignParentBottom="true"
android:background="@color/white">
<!-- THIS IS THE RECYCLERVIEW GIVING ME THE PROBLEMS. ITS NOT SCROLLING ON API 19 , WHY ??? -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_directions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="5"
tools:listitem="@layout/ride_direction_row" />
</RelativeLayout>
, когда я надуваю эту вещь, она помещается в пользовательский вид CoordinatorLayout.сам этот контейнер можно прокручивать.Что я делаю не так, что он работает на последних версиях Android, но не леденец?я даже попытался использовать appBarLayout и положить туда headerView, но то же самое только на старой версии Android, не работает.Я готов изменить XML полностью, если вы можете предложить лучший подход?
примечание: настройка android: nestedScrollingEnabled = false приведет к тому, что мой recyclerView не будет пересылать сообщения в форме recycler.У меня есть большие изображения в списке, поэтому мне нужна эта функция.