0
我正在尝试制作一个xml,其中有一些按钮以及一些带textviews的edittext。但是当我尝试添加多行的edittext时,它会保存它开始显示错误,如“java.util.LinkedHashMap.eldest()Ljava/util/Map $ Entry;” 我的XML代码:在控制台上添加EditText时出现Android XML错误
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/to"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="24dp"
android:layout_marginTop="15dp"
android:text="@string/to"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/toname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/to"
android:layout_below="@+id/to"
android:layout_marginLeft="28dp"
android:layout_marginTop="18dp"
android:ems="10"
android:hint="@string/toname"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/tophone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/toname"
android:layout_below="@+id/toname"
android:layout_marginTop="16dp"
android:hint="@string/tophone"
android:ems="10"
android:inputType="phone" />
<Button
android:id="@+id/importbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/tophone"
android:layout_below="@+id/tophone"
android:text="@string/importbutton" />
<EditText
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/to"
android:layout_alignRight="@+id/importbutton"
android:layout_below="@+id/importbutton"
android:layout_marginTop="38dp"
android:ems="10"
android:hint="@string/text"
android:inputType="textMultiLine"
android:lines="7"/>
<Button
android:id="@+id/sendbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/text"
android:text="@string/sendbutton" />
</RelativeLayout>
plz帮助如何使这个......
这应该被评 – 2012-07-28 09:44:29
日Thnx,它工作但即时通讯只有一行,我想在这个edittext中显示7行,因为它是一个多行文本... – Jpm 2012-07-28 09:48:28
其实你的设计布局在我的系统中工作正常。我没有明确你得到错误的哪一点。你能突出这一点吗? – 2012-07-28 09:51:23