0

I want to make a button like this by a compound view!

enter image description here

I am following this tutorial, but I am not able to make a view like this.

Can anybody show me some direction?

Nilesh Singh
  • 1,701
  • 1
  • 14
  • 27
MD TAHMID HOSSAIN
  • 1,473
  • 5
  • 27
  • 52

1 Answers1

1

try this

    <FrameLayout   
    android:layout_width="210dp"
    android:layout_height="210dp"
    //set framelayout clickable
    ><Button
        android:id="@+id/filter"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="7dp"
        android:background="#0000FF"
        android:gravity="center"
        android:paddingBottom="25dp"
        android:paddingTop="25dp"
        android:text="Sort"
        android:textColor="#FFFFFF" />

    <ImageView
        android:id="@+id/widget_title_icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="top|right"
        android:adjustViewBounds="true"
        android:paddingTop="-10dp"
        android:scaleType="fitStart"
        android:src="@drawable/checkbtn" />

</FrameLayout>

play around with this : android:paddingTop="-10dp"

this is what it will look like somewhat : here is

Raut Darpan
  • 1,452
  • 6
  • 14