1.錯誤顯示在打開TextView標記的行上,但它一直移動到不同的行,所以我不確定。 2.另外,對不起,如果其書面只是不好,這是我在編程解析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:padding="10dp" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:ide="@+id/text_prompt"
android:text="Enter the total bill amount"
android:textSize="20sp" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:ems="10"
android:inputType="numberDecimal" />
</requestFocus>
<EditText/>
<Button
android:id="@+id/tip20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="20 Percent"
android:layout_alignParentBottom="true" />
<Button
android:id="@+id/tip15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="50dp"
android:text="15 Percent" />
<Button
android:id="@+id/tip10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="100dp"
android:text="10 Percent" />
<TextView
android:id="@+id/tip_prompt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="Select a tip amount:"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="150dp" />
</RelativeLayout>
現在它給我一個垃圾文件元素後出錯 –
@MattBoggs,編輯我的答案;) – localhost
仍然是同樣的事情。我正在跟着一個教程,所以我不知道什麼是錯的 –