FloatingActionButton icon indicating copy to clipboard operation
FloatingActionButton copied to clipboard

FloatingActionMenu in the bottom center of coordinator layout

Open jugalptl opened this issue 8 years ago • 2 comments

I am trying to make FloatingActionMenu in the bottom center part of the Coordinator layout. I am using android:layout_gravity="bottom|center" for FAM but not working for me. Here is the XML code

<android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent">

    <com.github.clans.fab.FloatingActionMenu
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="bottom|center"
        app:menu_fab_size="normal">
        <com.github.clans.fab.FloatingActionButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/snack"/>

    </com.github.clans.fab.FloatingActionMenu>
</android.support.design.widget.CoordinatorLayout>

Any suggestions..?

jugalptl avatar Dec 02 '17 18:12 jugalptl

I do this you can use a Linearlayout and then set gravity to LinearLayout

<LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|left"
        android:layout_margin="6dp"
        android:orientation="horizontal"
        app:layout_anchor="@+id/include"
        app:layout_anchorGravity="right|bottom">

        <com.github.clans.fab.FloatingActionButton
            android:id="@+id/find_my_place_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|right"
            android:layout_marginBottom="8dp"
            android:src="@mipmap/ic_loc"
            app:fab_colorNormal="#47a6f4"
            app:fab_colorPressed="#3a75bc"
            app:fab_colorRipple="#99FFFFFF"
            app:fab_shadowColor="#66000000"
            app:fab_showShadow="true" />
</LinearLayout>

MostafaPirhayati avatar Jan 09 '18 13:01 MostafaPirhayati

have you find any solution. i also face the same issue.

faizan321 avatar Aug 02 '19 11:08 faizan321