使新浮动操作按钮的位置静止

时间:2015-07-27 18:39:25

标签: android floating-action-button

我如何让我的FAB具有静态位置。即它在协调器布局的滚动上不上升或下降?我没有在res-auto或常规android命名空间中看到一个选项..

这是布局:

z-index

1 个答案:

答案 0 :(得分:2)

尝试将fab按钮放在侧框布局中。 这个,

<FrameLayout
    android:id="@+id/rootLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fabBtn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:src="@drawable/ic_plus"
        app:fabSize="normal" />

</FrameLayout>
相关问题