Can I overlay a button on top of another?

I am trying to overlay a button on top of another button. The reason is because I want to explain to the user what certain buttons will do.

For example: There will be a button. There will be a question mark in the upper right or any of these buttons. When the user clicks the question mark, he will explain what this button does.

+5
source share
2 answers

Try using relative layout. Link: http://developer.android.com/reference/android/widget/RelativeLayout.html This will allow you to overlap.

Relativelayout , .

RelativeLayout , - .

<RelativeLayout
android:id="@+id/mybutton"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/button_bg"
>
<ImageView
    android:id="@+id/image"
    android:layout_alignParentRight="true"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    style="@style/icon"
    />
</RelativeLayout>

.

+6

, :

   <RelativeLayout>
      <Button
        android:id="@+id/btnOne"/>
      <Button
        android:id="@+id/btnTwo"
        android:layout_alignTop="@id/btnOne"
        android:layout_alignLeft="@id/btnOne"/>
    </RelativeLayout>
+12

All Articles