我正在使用 Android 4.2 和 Eclipse indigo (3.7.0)。我创建了一个TableLayout
6 行。我想在 Eclipse 中使用图形布局在一行中添加一个TextView
和一个。EditText
添加没问题TextView
,但是当我拖放时EditText
,显示以下错误:
NOTE: This project contains Java compilation errors, which can cause rendering failures for custom views. Fix compilation problems first.
java.util.LinkedHashMap.eldest()Ljava/util/Map$Entry;
我还没有写任何代码。当我第一次创建项目时,任何代码都是由 eclipse 生成的。editText 包含在 xml 中,但图形布局无法显示它。我剪切并粘贴了xml:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="1,2,3" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10" >
<requestFocus />
</EditText>
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow5"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow6"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
</TableLayout>