android - How to make view over recyclerview permanent example not scroll in nestedscrollview -


hi want make view not scroll able on recyclerview,for example textview above recyclerview in nestedscrollview,how can make textview not scrolling while recycler scroll usual

my code

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.nestedscrollview     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     xmlns:app="http://schemas.android.com/apk/res-auto"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:keepscreenon="true"     app:layout_behavior="@string/appbar_scrolling_view_behavior"     android:fillviewport="true" >      <relativelayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:gravity="center_horizontal"         android:focusableintouchmode="true"         android:paddingbottom="@dimen/activity_vertical_margin"         android:paddingleft="@dimen/activity_horizontal_margin"         android:paddingright="@dimen/activity_horizontal_margin"         android:paddingtop="@dimen/activity_vertical_margin" >          <textview             android:id="@+id/textview"             android:textcolor="#43a047"             android:typeface="serif"             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:layout_alignparenttop="true"             android:text="@string/app"             android:gravity="center"             android:textstyle="bold"             android:textsize="15sp" />          <android.support.v7.widget.recyclerview             xmlns:android="http://schemas.android.com/apk/res/android"             android:id="@+id/recyclerview"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:layout_below="@+id/textview"             android:layout_margintop="5dp"             android:divider="@color/coloraccent"             android:dividerheight="1dp" />  </relativelayout>  </android.support.v4.widget.nestedscrollview> 

how make textview not scroll

you have textview inside nestedscrollview. textview scrolls because of parent view. work:

<?xml version="1.0" encoding="utf-8"?> <relativelayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:focusableintouchmode="true" >      <textview         android:id="@+id/textview"         android:textcolor="#43a047"         android:typeface="serif"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_alignparenttop="true"         android:text="@string/app"         android:gravity="center"         android:textstyle="bold"         android:textsize="15sp" />      <android.support.v7.widget.recyclerview         android:id="@+id/recyclerview"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_below="@+id/textview"         android:layout_margintop="5dp"         android:divider="@color/coloraccent"         android:dividerheight="1dp" /> </relativelayout> 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -