Я реализовал плавающую кнопку действия в своих макетах. Проблема в том, что когда у меня слишком много данных в моем макете, кнопка не остается в том же положении, она прокручивается до нижней части макета. Мне нужно то же самое, что и почтовый ящик gmail: плавающая кнопка, которая всегда доступна, независимо от данных.Плавающее действие Кнопка прокрутки с контентом
Это мой код, чтобы показать кнопку
<?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>
Что происходит?
Спасибо за помощь!
http://stackoverflow.com/questions/35338316/how-to-set-the-fixed-position-for-floating-action-button-above-very-long-listvie –