Asjadaun
Asjadaun

Reputation: 23

Anchroing Fab Button

How do i anchor fab at the red marked position in image attached below. Any help is appreciated. Also please visit this git hub link to suggest change. Github link

Image for reference

Upvotes: 1

Views: 67

Answers (2)

Asjadaun
Asjadaun

Reputation: 23

<android.support.design.widget.FloatingActionButton
            android:id="@+id/share_fab"
            android:layout_width="@dimen/fab_width"
            android:layout_height="@dimen/fab_height"
            android:clickable="true"
            app:rippleColor="@color/secondaryDarkColor"
            android:contentDescription="@string/action_share"
            android:src="@drawable/ic_share"
            app:borderWidth="0dp"
            android:layout_marginLeft="700dp"
            app:elevation="@dimen/fab_elevation"
            app:layout_anchor="@id/meta_bar"
            app:layout_anchorGravity="bottom"
            tools:ignore="RtlHardcoded" />

I have done it like this.

Upvotes: 0

AskNilesh
AskNilesh

Reputation: 69689

As per my above comment

Just remove android:layout_margin="@dimen/fab_margin" from FloatingActionButton

like this

<android.support.design.widget.FloatingActionButton
                android:id="@+id/share_fab"
                android:layout_width="@dimen/fab_width"
                android:layout_height="@dimen/fab_height"
                android:clickable="true"
                app:rippleColor="@color/secondaryDarkColor"
                android:contentDescription="@string/action_share"
                android:src="@drawable/ic_share"
                app:borderWidth="0dp"
                app:elevation="@dimen/fab_elevation"
                app:layout_anchor="@id/meta_bar"
                app:layout_anchorGravity="right|bottom" />

Upvotes: 1

Related Questions