通过设置左边控件的属性即可,代码如下:
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="hello_world"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello_world2" />
hello_world2的宽度会挤压hello_world的空间。