求一个简单布局:右边三个按钮并排靠右,左边一个输入框填满其他空间,谢谢
如我的一行要显示四个控件
TextView1,Button1,Button2,Button3
要求是
Button1,Button2,Button3 靠屏幕的右边显示
TextView1 靠左边显示,并占满剩下的所有空间
谢谢
分享到:
------解决方案--------------------
把三个button 包在一个LinearLayout或者RelativeLayout里面,这个Layout和TextView横向布局,它们二者的父组件选RelativeLayout相对布局就可以
------解决方案--------------------
引用:
楼上的,我这个是要占满剩下的空间
已经占满了,你加上背景色看看
------解决方案--------------------
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/button1"
android:text="1231232131231231231232132131232132313213123123213" />
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Button1" />
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/button1"
android:text="Button2" />
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/button2"
android:text="Button3" />
------解决方案--------------------
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@+id/right"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:layout_marginLeft="3dp"
android:orientation="vertical" >
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="btn1" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="btn2" />
android:layout_width="wrap_content"