Reputation: 23
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
Upvotes: 1
Views: 67
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
Reputation: 69689
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