1

これを組み合わせて試してみましたが、一部の人はバグだと言っていましたが、それは私が紛失している小さなものだと思います。以下のXMLでは、私はまったくスクロールできません。水平スクロールだけが動作します。NestedScrollView内の水平RecyclerViewは垂直方向にスクロールできません

私は左右にドラッグすることができるサイドスクロールRecyclerViewを持っていますが、ページにはフィットできるものより多くの項目があり、したがってScrollViewがあります。

最初は折りたたみ可能なツールバーを目指していましたが、CoordinatorLayoutを追加するとアクティビティは空白になります。

マイXML:是非みてみ神様の愛を私にこれのsh * tを説明

<android.support.constraint.ConstraintLayout 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:nestedScrollingEnabled="true" 
    app:layout_constraintTop_toBottomOf="@+id/scrollv" 
    tools:context="com.wearecatchapp.blueandwhite.catchapp_droid.EventDetailActivity"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/detail_toolbar" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:background="#fff" 
     android:elevation="2dp" 
     android:minHeight="60dp" 
     android:theme="@style/ThemeOverlay.AppCompat.ActionBar" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintRight_toRightOf="parent" 
     app:layout_scrollFlags="scroll|enterAlwaysCollapsed" 
     app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> 

     <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent" 
      android:layout_gravity="center" 
      android:gravity="center" 
      android:orientation="vertical"> 

      <TextView 
       android:id="@+id/evt_title" 
       fontPath="fonts/PanameFY.otf" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:textAlignment="center" 
       android:textColor="@color/black" 
       android:textSize="30sp" /> 

      <LinearLayout 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:padding="2dp" 
        android:text="Organizer's level:" 
        android:textAlignment="center" 
        android:textColor="@color/black" 
        android:textSize="12sp" /> 

       <ImageView 
        android:id="@+id/org_level" 
        android:layout_width="60dp" 
        android:layout_height="16dp" 
        android:layout_gravity="center_vertical" /> 
      </LinearLayout> 

      <TextView 
       android:id="@+id/optional_title" 
       fontPath="fonts/PanameFY.otf" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:padding="2dp" 
       android:textAlignment="center" 
       android:textColor="@color/black" 
       android:textSize="24sp" 
       android:visibility="gone" /> 

     </LinearLayout> 

    </android.support.v7.widget.Toolbar> 


    <android.support.v4.widget.NestedScrollView 
     android:id="@+id/scrollv" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:layout_constraintTop_toBottomOf="@+id/detail_toolbar"> 

     <android.support.constraint.ConstraintLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 


      <ImageView 
       android:id="@+id/activity_image" 
       android:layout_width="0dp" 
       android:layout_height="wrap_content" 
       android:adjustViewBounds="true" 
       app:layout_constraintHorizontal_bias="0.0" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 

       app:srcCompat="@color/black" /> 

      <TextView 
       android:id="@+id/month" 
       android:layout_width="70dp" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="16dp" 
       android:layout_marginStart="16dp" 
       android:layout_marginTop="8dp" 
       android:text="NOV" 
       android:textAlignment="center" 
       android:textColor="@android:color/holo_red_light" 
       android:textSize="18sp" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/activity_image" /> 

      <TextView 
       android:id="@+id/day" 
       android:layout_width="70dp" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="16dp" 
       android:layout_marginStart="16dp" 
       android:layout_marginTop="2dp" 
       android:text="15" 
       android:textAlignment="center" 
       android:textColor="@color/black" 
       android:textSize="24sp" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/month" /> 

      <TextView 
       android:id="@+id/starts" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="16dp" 
       android:layout_marginStart="16dp" 
       android:layout_marginTop="8dp" 
       android:text="Starts" 
       android:textColor="@color/black" 
       android:textSize="18sp" 
       app:layout_constraintLeft_toRightOf="@+id/month" 
       app:layout_constraintTop_toBottomOf="@+id/activity_image" /> 

      <TextView 
       android:id="@+id/ends" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="16dp" 
       android:layout_marginStart="16dp" 
       android:layout_marginTop="7dp" 
       android:text="Ends" 
       android:textColor="@color/black" 
       android:textSize="18sp" 
       app:layout_constraintLeft_toRightOf="@+id/day" 
       app:layout_constraintTop_toBottomOf="@+id/starts" /> 

      <TextView 
       android:id="@+id/start_date" 
       fontPath="fonts/AvenirNext-Medium.ttf" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="42dp" 
       android:layout_marginStart="42dp" 
       android:layout_marginTop="8dp" 
       android:text=" 18:10 Wed, Nov 15" 
       android:textColor="@color/black" 
       android:textSize="18sp" 
       app:layout_constraintLeft_toRightOf="@+id/starts" 
       app:layout_constraintTop_toBottomOf="@+id/activity_image" /> 

      <TextView 
       android:id="@+id/textView34" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="50dp" 
       android:layout_marginStart="50dp" 
       android:layout_marginTop="7dp" 
       android:textColor="@color/black" 
       android:textSize="18sp" 
       app:layout_constraintLeft_toRightOf="@+id/ends" 
       app:layout_constraintTop_toBottomOf="@+id/start_date" /> 

      <View 
       android:id="@+id/view10" 
       id="@+id/view8" 
       android:layout_width="0dp" 
       android:layout_height="1dp" 
       android:layout_marginTop="16dp" 
       android:background="@color/thegray" 
       app:layout_constraintHorizontal_bias="0.0" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/linearLayout2" /> 

      <View 
       android:id="@+id/view9" 
       android:layout_width="0dp" 
       android:layout_height="1dp" 
       android:layout_marginTop="9dp" 
       android:background="@color/thegray" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/textView34" /> 

      <LinearLayout 
       android:id="@+id/linearLayout" 
       android:layout_width="397dp" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="25dp" 
       android:orientation="horizontal" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/textView34"> 

       <ImageView 
        android:id="@+id/requests_image" 
        android:layout_width="24dp" 
        android:layout_height="24dp" 
        android:layout_weight="1" 
        app:srcCompat="@drawable/requestsicon" /> 

       <ImageView 
        android:id="@+id/invite_image" 
        android:layout_width="24dp" 
        android:layout_height="24dp" 
        android:layout_weight="1" 
        app:srcCompat="@drawable/invitefriends" /> 

       <ImageView 
        android:id="@+id/recommend_image" 
        android:layout_width="24dp" 
        android:layout_height="24dp" 
        android:layout_weight="1" 
        app:srcCompat="@drawable/recommend" /> 

       <ImageView 
        android:id="@+id/share_image" 
        android:layout_width="24dp" 
        android:layout_height="24dp" 
        android:layout_weight="1" 
        app:srcCompat="@drawable/shareblue" /> 
      </LinearLayout> 

      <LinearLayout 
       android:id="@+id/linearLayout2" 
       android:layout_width="396dp" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/linearLayout"> 

       <TextView 
        android:id="@+id/requests_text" 
        fontPath="fonts/avenir-next-bold.ttf" 
        android:layout_width="24dp" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:text="Requests" 
        android:textAlignment="center" 
        android:textColor="@color/black" 
        android:textSize="12sp" /> 

       <TextView 
        android:id="@+id/invite_friends_text" 
        fontPath="fonts/avenir-next-bold.ttf" 
        android:layout_width="24dp" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:text="Invite friends" 
        android:textAlignment="center" 
        android:textColor="@color/black" 
        android:textSize="12sp" /> 

       <TextView 
        android:id="@+id/recommend_event_text" 
        fontPath="fonts/avenir-next-bold.ttf" 
        android:layout_width="24dp" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:text="Recommend" 
        android:textAlignment="center" 
        android:textColor="@color/black" 
        android:textSize="12sp" /> 

       <TextView 
        android:id="@+id/share_text" 
        fontPath="fonts/avenir-next-bold.ttf" 
        android:layout_width="24dp" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:text="Share" 
        android:textAlignment="center" 
        android:textColor="@color/black" 
        android:textSize="12sp" /> 
      </LinearLayout> 

      <TextView 
       android:id="@+id/status_text" 
       fontPath="fonts/avenir-next-bold.ttf" 
       android:layout_width="0dp" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="16dp" 
       android:paddingLeft="8dp" 
       android:textColor="@color/dark_gray" 
       android:textSize="20sp" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/view10" /> 

      <ImageView 
       android:id="@+id/is_for" 
       android:layout_width="36dp" 
       android:layout_height="36dp" 
       android:layout_marginLeft="8dp" 
       android:layout_marginStart="8dp" 
       android:layout_marginTop="6dp" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/status_text" 
       app:srcCompat="@drawable/maleandfemale" /> 

      <TextView 
       android:id="@+id/going" 
       fontPath="fonts/AvenirNext-Medium.ttf" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="8dp" 
       android:layout_marginStart="8dp" 
       android:layout_marginTop="15dp" 
       android:text="going" 
       android:textColor="@color/black" 
       app:layout_constraintLeft_toRightOf="@+id/is_for" 
       app:layout_constraintTop_toBottomOf="@+id/status_text" /> 

      <TextView 
       android:id="@+id/more_togo" 
       fontPath="fonts/AvenirNext-Medium.ttf" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="20dp" 
       android:layout_marginStart="20dp" 
       android:layout_marginTop="15dp" 
       android:text="TextView" 
       android:textColor="@color/black" 
       app:layout_constraintLeft_toRightOf="@+id/hor_view" 
       app:layout_constraintTop_toBottomOf="@+id/status_text" /> 

      <View 
       android:id="@+id/hor_view" 
       class="android.support.v4.widget.Space" 
       android:layout_width="1dp" 
       android:layout_height="30dp" 
       android:layout_marginLeft="35dp" 
       android:layout_marginStart="35dp" 
       android:layout_marginTop="8dp" 
       android:background="@color/dark_gray" 
       app:layout_constraintLeft_toRightOf="@+id/going" 
       app:layout_constraintTop_toBottomOf="@+id/status_text" /> 

      <android.support.v7.widget.RecyclerView 
       android:id="@+id/participants_list" 
       android:layout_width="0dp" 
       android:layout_height="117dp" 
       android:layout_marginTop="12dp" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/hor_view" /> 

      <View 
       android:id="@+id/view16" 
       android:layout_width="0dp" 
       android:layout_height="1dp" 
       android:layout_marginTop="8dp" 
       app:layout_constraintHorizontal_bias="0.0" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/participants_list" /> 

      <TextView 
       android:id="@+id/textView47" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="16dp" 
       android:layout_marginStart="16dp" 
       android:layout_marginTop="17dp" 
       android:text="Costs" 
       android:textSize="18sp" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/view16" /> 

      <TextView 
       android:id="@+id/cost_text" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginEnd="8dp" 
       android:layout_marginRight="8dp" 
       android:layout_marginTop="17dp" 
       android:text="TextView" 
       android:textSize="18sp" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/view16" /> 

      <View 
       android:id="@+id/view19" 
       android:layout_width="0dp" 
       android:layout_height="1dp" 
       android:layout_marginTop="55dp" 
       app:layout_constraintHorizontal_bias="0.0" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/view16" /> 

      <TextView 
       android:id="@+id/cost_title_text" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="16dp" 
       android:layout_marginStart="16dp" 
       android:layout_marginTop="13dp" 
       android:textSize="18sp" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/view19" /> 

      <View 
       android:id="@+id/view20" 
       android:layout_width="0dp" 
       android:layout_height="1px" 
       android:layout_marginTop="16dp" 
       android:background="@color/thegray" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/view19" /> 

      <ImageView 
       android:id="@+id/imageView15" 
       android:layout_width="40dp" 
       android:layout_height="40dp" 
       android:layout_marginLeft="16dp" 
       android:layout_marginStart="16dp" 
       android:layout_marginTop="16dp" 
       android:padding="8dp" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/view20" 
       app:srcCompat="@drawable/pinblue" /> 

      <TextView 
       android:id="@+id/textView50" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="7dp" 
       android:layout_marginStart="7dp" 
       android:layout_marginTop="16dp" 
       android:text="Event location" 
       android:textColor="@color/colorPrimary" 
       android:textSize="18sp" 
       app:layout_constraintLeft_toRightOf="@+id/imageView15" 
       app:layout_constraintTop_toBottomOf="@+id/view20" /> 

      <ImageView 
       android:id="@+id/imageView5" 
       android:layout_width="40dp" 
       android:layout_height="40dp" 
       android:layout_marginLeft="16dp" 
       android:layout_marginStart="16dp" 
       android:layout_marginTop="16dp" 
       android:padding="8dp" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintTop_toBottomOf="@+id/textView50" 
       app:srcCompat="@drawable/background" /> 
     </android.support.constraint.ConstraintLayout> 

    </android.support.v4.widget.NestedScrollView> 


    <android.support.v7.widget.CardView 
     android:layout_width="0dp" 
     android:layout_height="60dp" 
     android:layout_marginBottom="29dp" 
     android:layout_marginEnd="40dp" 
     android:layout_marginLeft="40dp" 
     android:layout_marginRight="40dp" 
     android:layout_marginStart="40dp" 
     app:cardBackgroundColor="@color/colorPrimary" 
     app:cardCornerRadius="18dp" 
     app:cardElevation="16dp" 
     app:layout_constraintBottom_toBottomOf="parent" 
     app:layout_constraintHorizontal_bias="0.0" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintRight_toRightOf="parent"> 


     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_vertical|center_horizontal" 
      android:text="REQUEST TO JOIN" 
      android:textColor="@android:color/white" 
      android:textSize="14dp" /> 
    </android.support.v7.widget.CardView> 
</android.support.constraint.ConstraintLayout> 

誰か。

+0

この行を追加する* mRecyclerView.setNestedScrollingEnabled(false); * onCreateメソッド –

答えて

0

内側のrecyclerviewにsetNestedScrollingEnabled(false)を追加してみてください。

https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html

このビューのネストされたスクロールを有効または無効にします

をsetNestedScrollingEnabled。

このプロパティをtrueに設定すると、 の現在の階層で互換性のある親ビューを持つ ネストスクロール操作を開始できます。このビューで入れ子スクロールが実装されていない場合 これは効果がありません。ネストされたスクロールを無効にすると、ネストされたスクロールを停止する効果があります。

0

1)XML

android.support.v4.widget.NestedScrollView

2 LinerLayout 内使用) recyclerView =(RecyclerView)view.findViewById(R.id.recyclerview_main)。 recyclerView.setNestedScrollingEnabled(false);

関連する問題