文字left,按钮right,edittext在文字right,在按钮left。这样就満了。
父布局:relativelayout

解决方案 »

  1.   

    用一个linearlayout,设置为horizontal,里面的布局用weight来控制长度就好了。。
      

  2.   

    你可以这样
    <LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"> <TextView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" /> <EditText 
    android:layout_width="0dp"
    android:layout_height="wrap_content" /
    android:layout_weight="1"> <TextView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" /> </LinearLayout>
      

  3.   

    LinearLayout布局,用weight来平分宽度。
      

  4.   


    <LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
     
     <TextView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" /> 
     
    <EditText 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" /
    android:layout_weight="1">
     
     <TextView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" /> 
     
    </LinearLayout>
      

  5.   

    可以用TableLayout加TableRow形式  
      

  6.   

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity" >    <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_marginTop="144dp"
            android:text="@string/hello_world" />    <EditText
            android:id="@+id/editText1"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_alignTop="@+id/textView1"
            android:layout_toRightOf="@+id/textView1"
            android:ems="10" >        <requestFocus />
        </EditText>    <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="0dp"
            android:layout_alignBottom="@+id/editText1"
            android:layout_alignParentRight="true"
            android:text="Button" /></RelativeLayout>
      

  7.   

    tablelayout  规定 第二列 为可伸缩   其实 有很多方法了 上面讲了。。