Android - FAB 的位置怎么实现

图片描述

这种Floating Action Button 的位置感觉在两个 ViewGroup之间,怎么实现?谢谢~

阅读 5k
1 个回答
<android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/fab_margin"
        android:src="@drawable/ic_add_black_24dp"
        custom:layout_anchor="@id/app_bar"
        custom:layout_anchorGravity="bottom|left"/>
        

where custom refers to xmlns http://schemas.android.com/apk/res-auto, and app_bar is a android.support.design.widget.AppBarLayout.

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题