0
我有一个EditText并且没有多行显示,没有出现错误的地方,谢谢你所显示的兴趣。 我喜欢 “的EditText”:Edittext not show multiline
线1 ==> s_p1
线2 ==> s_p2
线3 ==> s_postre
XML
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dip" >
<Button
android:id="@+id/bt_comida"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0.15"
android:background="@drawable/ic_comida" />
<EditText
android:id="@+id/et_com"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.85"
android:clickable="true"
android:cursorVisible="false"
android:gravity="top|left"
android:inputType="textMultiLine"
android:singleLine="false"
android:hint="@string/tv_com"
android:textColor="@color/Black"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
CODE
String s_union = s_p1 + "\n" + s_p2 + "\n" + s_postre;
et_com.setText(s_union);
为什么EditText宽度在这里为零? –
谢谢你的回复。这个血清错误。他会验证它 – d2000k
android:layout_width =“wrap_content”。它给出了相同的错误 – d2000k