Autore Topic: ListView e CordinatorLayout  (Letto 280 volte)

Offline tonno16

  • Utente storico
  • *****
  • Post: 1197
  • Respect: +58
    • Mostra profilo
  • Dispositivo Android:
    moto g
  • Play Store ID:
    Diego Tonini
  • Sistema operativo:
    OpenSuse
ListView e CordinatorLayout
« il: 24 Novembre 2015, 16:20:44 CET »
0
Salve a tutti.
Ho la mia activity con:

--Cordinator
----AppBarLayout
------Toolbar
--------mio layout custom
---/AppBarLayout
---ListView
--/Cordinator

xml:
Codice (XML): [Seleziona]
<android.support.design.widget.CoordinatorLayout
   android:id="@+id/main_content"
   xmlns:fab="http://schemas.android.com/apk/res-auto"
   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:fitsSystemWindows="true"
   tools:context=".MainActivity">

    <android.support.design.widget.AppBarLayout android:id="@+id/appbar"
       android:layout_width="match_parent" android:layout_height="wrap_content"
       android:paddingTop="@dimen/appbar_padding_top"
       android:theme="@style/AppTheme.AppBarOverlay"
       android:fitsSystemWindows="true">

        <android.support.v7.widget.Toolbar android:id="@+id/toolbar"
           android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"
           android:background="?attr/colorPrimary" android:theme="@style/AppTheme.PopupOverlay"
           app:layout_scrollFlags="scroll|enterAlways">

            <include layout="@layout/toolbar"
               android:animateLayoutChanges="true"/>

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

        <android.support.design.widget.TabLayout android:id="@+id/tabs"
           android:layout_width="match_parent" android:layout_height="wrap_content"/>

    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager android:id="@+id/container"
       android:visibility="gone"
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:layout_above="@+id/imageView"
       android:layout_below="@+id/appbar"
       app:layout_behavior="@string/appbar_scrolling_view_behavior"
       android:animateLayoutChanges="true"/>

    <ImageView
       android:visibility="gone"
       android:layout_width="match_parent"
       android:layout_alignParentBottom="true"
       android:layout_height="35dp"
       android:src="@drawable/logo_flli_iara"
       android:id="@+id/imageView" />

    <com.melnykov.fab.FloatingActionButton
       android:visibility="gone"
       android:id="@+id/fabLocation"
       android:layout_margin="16dp"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_gravity="bottom|center"
       android:src="@drawable/ic_place_white_24dp"
       fab:fab_colorNormal="@color/md_pink_500"
       fab:fab_colorPressed="@color/md_pink_700"
       fab:fab_colorRipple="@color/md_pink_500"
       app:layout_behavior="sportevent.pianetaitalia.sportevent.custom.FloatingActionButtonBehavior"
       android:layout_alignParentBottom="true"
       android:layout_alignParentRight="true"
       android:layout_alignParentEnd="true" />

    <ListView
       xmlns:android="http://schemas.android.com/apk/res/android"
       android:id="@+id/listView"
       app:layout_behavior="@string/appbar_scrolling_view_behavior"
       android:layout_width="match_parent"
       android:layout_height="match_parent" />

</android.support.design.widget.CoordinatorLayout>

Come vedete ho layout_behavior sulla ListView.
Ho il mio cordnator.
Lo scrol non nasconde niente. Non succede niente di quello che mi aspetto.

Pensavo funzionasse anche con listView, oppure solo recycleView?