Ad

Adding A Button On The Baseline Of A Layout

How to place a button on the baseline of a layout as shown in the image below

enter image description here

Ad

Answer

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

        <android.support.v7.widget.CardView
            android:id="@+id/cardView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:cardCornerRadius="7dp"
            app:cardElevation="22dp">


        </android.support.v7.widget.CardView>

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_anchor="@+id/cardView"
            app:srcCompat="@drawable/ic_facebook"
            app:layout_anchorGravity="center|bottom" />

    </android.support.design.widget.CoordinatorLayout>
Ad
source: stackoverflow.com
Ad