마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

안드로이드 nestedscrollview recyclerview 적용이 안됩니다

0 추천
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    android:fillViewport="true"
    android:overScrollMode="never"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:id="@+id/UserName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="44dp"
            android:text="TextView"
            android:textColor="@color/black"
            android:textSize="15dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/detailviewfragment_recyclerview"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/guideline4"
            android:nestedScrollingEnabled="false"
            android:overScrollMode="never"/>
    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
androiddong (140 포인트) 님이 2023년 3월 2일 질문

1개의 답변

0 추천
제 기억으로는 ConstraintLayout은 같이 사용하면 안되었던 것 같아요. RelativeLayout이나 LinearLayout으로 시도해 보시고

다른 방법으로는 CollapsingToolbarLayout 을 이용해서도 거의 비슷한 효과를 냈던 것 같아요.

또는username 텍스뷰를 멀티뷰타입을 이용하여 리사이클러뷰에 집어 넣는 방법도 사용할 수도 있습니다.
spark (227,530 포인트) 님이 2023년 3월 2일 답변
spark님이 2023년 3월 2일 수정
...