ich die folgende Layout xml für meine TätigkeitWie FAB zu verhindern, dass mit CoordinateLayout in Android-Scrolling
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:fitsSystemWindows="true"
tools:context=".HomeActivity">
<android.support.design.widget.AppBarLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.Dark.AppBarOverlay"
app:elevation="0dp">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.Dark.PopupOverlay">
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:id="@+id/rl_updates"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/ll_footer"
android:layout_below="@+id/ll_fibres_search">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srl_updates"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_all_requirements"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@color/iron"
android:dividerHeight="1px"/>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:onClick="onRequirement"
android:overScrollMode="never"
android:src="@drawable/ic_playlist_add_white_24dp"
app:backgroundTint="@color/pink"/>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
habe Wenn ich die Recycler Ansicht scrollen, kollabiert die App Bar genauso wie ich es sein wollte. Aber das Problem ist, dass der FAB auch ein wenig nach unten schaltet. Ich setze 16dp Rand nach unten, aber es bleibt an der Unterseite des Bildschirms.
Wie verhindere ich, dass der FAB anfänglich heruntergeschaltet wird?
Diese nicht –
die FAB-Taste innerhalb eines releative Layout verwenden funktioniert und den obigen Code zu tun und geben Marge der Knopf – Sam