http://img804.imageshack.us/img804/9858/howtowrapmiddletext.png
基本上我有一个列表视图,分为三个部分。左边是一个图像,右边是一个按钮,中间是我想要包装的文本。看看我的照片
这是我的XML布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ic_tab_drink_selected"
android:id="@+id/img1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="16sp"
android:id="@+id/text1"/>
<Button
android:id="@+id/btn1"
android:layout_width="60dp"
android:layout_height="60dp"
/>
</LinearLayout>
最佳答案
好吧,这里有几件事你可以试试:
1)您的线性布局中是否有android:orientation="horizontal"
?
2)对于EditText,设置android:inputType="textMultiLine"
如果那不起作用,
3)对于EditText,设置android:layout_width="0dip"
和android:layout_weight="1"