Android 浮动操作按钮卡在导航栏下方
我正在尝试将新的(ish)android.support.design.widget.FloatingActionButton添加到我的项目中,但遇到了一些困难。在预棒棒糖设备上,操作按钮看起来很好。在棒棒糖设备上,它停靠在窗口的底部,这意味着它被底部的导航条切断了一半 请注意,我正在尝试添加一个类似于Gmail应用程序的FAB,它停靠在屏幕的右下角 我做错了什么?我的XML文件:Android 浮动操作按钮卡在导航栏下方,android,android-5.0-lollipop,floating-action-button,Android,Android 5.0 Lollipop,Floating Action Button,我正在尝试将新的(ish)android.support.design.widget.FloatingActionButton添加到我的项目中,但遇到了一些困难。在预棒棒糖设备上,操作按钮看起来很好。在棒棒糖设备上,它停靠在窗口的底部,这意味着它被底部的导航条切断了一半 请注意,我正在尝试添加一个类似于Gmail应用程序的FAB,它停靠在屏幕的右下角 我做错了什么?我的XML文件: <?xml version="1.0" encoding="utf-8"?> <ScrollVi
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="match_parent"
android:fillViewport="true" >
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_color"
android:longClickable="true"
android:choiceMode="multipleChoice" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="60dp"
android:layout_height="60dp"
app:borderWidth="0dp"
android:layout_margin="@dimen/fab_margin"
android:elevation="44dp"
android:clickable="true"
android:onClick="onAddButtonClick"
android:src="@drawable/ic_fab"
android:layout_gravity="bottom|right|end"
android:adjustViewBounds="false"
android:baselineAlignBottom="true" />
</android.support.design.widget.CoordinatorLayout>
</ScrollView>
尝试将android:layout|u gravity=“bottom | right | end”更改为android:layout|u gravity=“top | right”我正在尝试将其停靠在右下角,右上角没有任何意义。尝试删除scrollview删除scrollview会使xml文件更干净,但遗憾的是无法解决我的问题:(这可能会帮助您)。