I nerd to create sticky headers in my android application. So I followed a tutorial to create them and in it the user has added to lines in his xml file.
This are the lines:
android:layout_behavir="@string/appbar_scrolling_view_behavior"
android:layout_scrollFlags="scroll|exitUntilcolapsed">
But when I try to add the two lines to my code the autocomplete don't recognize them and if I add them anyway the application gives an error.
I have read around and what I found was to include the android.support.design library. I have don that but my problem persist.
Can someone give mi a full example of how to put this to work?
This is my XML file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context="com.example.manuelrodrigues.myapplication.ScrollingActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|exitUntilcolapsed"
android:layout_behavir="@string/appbar_scrolling_view_behavior"
android:layout_scrollFlags="scroll|exitUntilcolapsed">
<TextView
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="#ff0000"
android:text="Teste" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="#00ff00"
android:text="Teste3" />
</LinearLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_scrolling" />
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>