Possible to overlay a Button on top of another?

梦想与她 提交于 2019-12-05 10:33:49

Try using a Relative Layout. Link: http://developer.android.com/reference/android/widget/RelativeLayout.html It'll let you overlay.

Relativelayout will let you align images beside each other easily as well as on top of each other.

Why don't you make the RelativeLayout your button and put your question mark inside it, align it to the right or something.. e.g

<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>

You can attach listeners to both.

That's what came to mind, try it:

   <RelativeLayout>
      <Button
        android:id="@+id/btnOne"/>
      <Button
        android:id="@+id/btnTwo"
        android:layout_alignTop="@id/btnOne"
        android:layout_alignLeft="@id/btnOne"/>
    </RelativeLayout>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!