How to show a button half on one layout and half on another layout in android?

前端 未结 1 1181
醉话见心
醉话见心 2021-01-21 13:43

I want to design a layout like the image below:

\"enter

I tried to do it using Rel

相关标签:
1条回答
  • 2021-01-21 14:09

    You can put the Button declaration outside of your RelativeLayout relative_layout_bottom and then place it where you like.

    For example: Edit:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    
        <RelativeLayout
            android:id="@+id/relative_layout_top"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/obaz" >
        </RelativeLayout>
    
        <Button
            android:id="@+id/bt_atoz"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:background="@drawable/button_active" />
    
        <RelativeLayout
            android:id="@+id/relative_layout_bottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/relative_layout_top"
            android:background="@drawable/obaz2" >
        </RelativeLayout>
    
    </RelativeLayout>
    
    0 讨论(0)
提交回复
热议问题