J'ai mis en place un bouton d'action flottante dans mes mises en page. Le problème est quand j'ai trop de données dans ma disposition, le bouton ne reste pas dans la même position, il défile vers le bas de la mise en page. J'ai besoin de la même boîte de réception Gmail: un bouton flottant qui est toujours accessible, peu importe les données.Floating Action Bouton faire défiler avec le contenu
Ceci est mon code pour afficher le bouton
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<include
android:id="@+id/frgOffline"
android:visibility="gone"
layout="@layout/frg_offline"/>
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" card_view:cardBackgroundColor="@android:color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:layout_marginBottom="7dp"
android:layout_marginTop="7dp"
android:gravity="center_vertical|left">
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="25dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="text"
android:layout_marginBottom="15dp"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp"
android:layout_margin="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<com.exampleapp.expandiblelist
android:id="@+id/expListaResultado"
android:groupIndicator="@null"
android:layout_height="fill_parent"
android:transcriptMode="disabled"
android:layout_width="match_parent"/>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/btnNueva"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:src="@drawable/ic_nuevo"
android:layout_gravity="bottom|right"
app:backgroundTint="@color/blue"/>
</android.support.v7.widget.CardView>
</LinearLayout>
Que se passe-t-il?
Merci de votre aide!
http://stackoverflow.com/questions/35338316/how-to-set-the-fixed-position-for-floating-action-button-above-very-long-listvie –