0

我问了同样的问题,问题链接是:如何在一个布局上显示一个按钮一半在 android 的另一个布局上显示一半? 我没有找到任何解决这个问题的方法。我想让这个布局对所有设备都有响应。任何人都可以帮助我摆脱这个问题。

4

1 回答 1

2

Try this..!Let me know if it helps.

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

 <LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
     >

   <LinearLayout 
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       android:layout_weight="1"
       android:background="#d67070">

    <RelativeLayout
        android:id="@+id/relative_layout_top"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        >

    </RelativeLayout>
 </LinearLayout>


 <LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:background="#70a7d6">

    <RelativeLayout
        android:id="@+id/relative_layout_bottom"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/relative_layout_top"
         >
    </RelativeLayout>

    </LinearLayout>

</LinearLayout>

 <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:text="Button"
    android:textColor="#000000"
    android:layout_marginRight="10dp"
    android:background="#ffffff"
     />

</RelativeLayout>
于 2013-06-14T07:06:18.083 回答