需求如题
代码
<LinearLayout
android:layout_width="480dp"
android:layout_height="wrap_content"
android:background="#fff"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:background="#0ff"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:layout_weight="1"
android:text="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" />
<TextView
android:background="#0f0"
android:text="Button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:background="#ff0"
android:text="Button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
注意必须使用LinearLayout,相对布局无法实现该效果。(会出现权重失效)