XML : Recyclerview in NestedScrollView, possible?

I need to put a RecyclerView into a NestedScrollView but it doesn't work out for me. Is there possible way to achieve that? Some sites tell that it is possible others say it's not, but there is never a clear answer. Also I would like to know if the RecyclerView is in the write place, if I would put it into my content XML File. Thankful for any help!

content_mein_profil.xml

  <?xml version="1.0" encoding="utf-8"?>  <android.support.v4.widget.NestedScrollView 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"      app:layout_behavior="@string/appbar_scrolling_view_behavior"      tools:context="com.appmac.ron.profile.ScrollingActivity"      tools:showIn="@layout/activity_mein_profil">        <android.support.v7.widget.CardView          xmlns:card_view="http://schemas.android.com/apk/res-auto"          android:id="@+id/cardViewMeinProfil"          android:layout_width="match_parent"          android:layout_height="wrap_content"          android:layout_marginLeft="10dp"          android:layout_marginRight="10dp"          android:layout_marginTop="15dp"          card_view:cardCornerRadius="0dp">            <RelativeLayout              android:layout_width="match_parent"              android:layout_height="wrap_content">                <TextView                  android:id="@+id/meinProfilProfilInformation"                  android:layout_width="match_parent"                  android:layout_height="wrap_content"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="10dp"                  android:text="Profil Informationen"                  android:textAppearance="?android:attr/textAppearanceLarge"                  android:textColor="#0d567b"                  android:textSize="14dp"                  android:textStyle="bold"                  android:typeface="sans" />                <View                  android:id="@+id/meinProfilTrennstrich"                  android:layout_width="wrap_content"                  android:layout_height="1dp"                  android:layout_below="@+id/meinProfilProfilInformation"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:background="#e4e4e4" />                <TextView                  android:id="@+id/meinProfilNickname"                  android:layout_width="match_parent"                  android:layout_height="wrap_content"                  android:layout_below="@+id/meinProfilTrennstrich"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:text="Text3"                  android:textAppearance="?android:attr/textAppearanceSmall"                  android:textColor="#6a6a6a"                  android:textSize="14dp"                  android:textStyle="bold" />                <TextView                  android:id="@+id/meinProfilAlter"                  android:layout_width="match_parent"                  android:layout_height="wrap_content"                  android:layout_below="@+id/meinProfilNickname"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:text="23 Jahre - New York"                  android:textAppearance="?android:attr/textAppearanceSmall"                  android:textColor="#6a6a6a"                  android:textSize="14dp" />                <TextView                  android:id="@+id/meinProfilWebsite"                  android:layout_width="match_parent"                  android:layout_height="wrap_content"                  android:layout_below="@+id/meinProfilAlter"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:text="Text5"                  android:textAppearance="?android:attr/textAppearanceSmall"                  android:textColor="#6a6a6a"                  android:textSize="14dp" />                <View                  android:id="@+id/meinProfilTrennstrich2"                  android:layout_width="wrap_content"                  android:layout_height="1dp"                  android:layout_below="@+id/meinProfilWebsite"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:background="#e4e4e4" />                <TextView                  android:id="@+id/meinProfilBiografie"                  android:layout_width="match_parent"                  android:layout_height="wrap_content"                  android:layout_below="@+id/meinProfilTrennstrich2"                  android:layout_marginBottom="10dp"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:text="@string/statusId"                  android:textAppearance="?android:attr/textAppearanceSmall"                  android:textColor="#6a6a6a"                  android:textSize="14dp" />            </RelativeLayout>        </android.support.v7.widget.CardView>    </android.support.v4.widget.NestedScrollView>    

activity_mein_profil.xml

  <?xml version="1.0" encoding="utf-8"?>  <android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true"      tools:context="com.appmac.ron.profile.ScrollingActivity">        <android.support.design.widget.AppBarLayout          android:id="@+id/app_bar"          android:layout_width="match_parent"          android:layout_height="@dimen/app_bar_height"          android:fitsSystemWindows="true"          android:theme="@style/AppTheme.AppBarOverlay">            <android.support.design.widget.CollapsingToolbarLayout              android:id="@+id/toolbar_layout"              android:layout_width="match_parent"              android:layout_height="match_parent"              android:fitsSystemWindows="true"              app:contentScrim="?attr/colorPrimary"              app:layout_scrollFlags="scroll|exitUntilCollapsed">                <ImageView                  android:layout_width="match_parent"                  android:layout_height="350dp"                  android:scaleType="centerCrop"                  android:src="@drawable/mysquad"                  app:layout_collapseMode="parallax"                  />                <android.support.v7.widget.Toolbar                  android:id="@+id/toolbar"                  android:layout_width="match_parent"                  android:layout_height="?attr/actionBarSize"                  app:layout_collapseMode="pin"                  app:popupTheme="@style/AppTheme.PopupOverlay" />            </android.support.design.widget.CollapsingToolbarLayout>      </android.support.design.widget.AppBarLayout>        <include layout="@layout/content_mein_profil" />        <android.support.design.widget.FloatingActionButton          android:id="@+id/fab"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:layout_margin="@dimen/fab_margin"          android:src="@drawable/ic_mode_edit_white_48dp"          app:backgroundTint="#ff4d00"          app:layout_anchor="@id/app_bar"          app:layout_anchorGravity="bottom|end" />      </android.support.design.widget.CoordinatorLayout>    

No comments:

Post a Comment