use*_*356 1 java xml android android-layout
我收到一个错误,说“ Cannot resolve symbol '@id/myLabel'”。以下元素也有同样的错误:
"Cannot resolve symbol '@id/numberStudents'"
"Cannot resolve symbol '@id/accept'"
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题。我的 xml 示例粘贴在下面。
谢谢,阿比拉什·卡达拉。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/myLabel"
android:text="Name of student:"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<EditText
android:id="@+id/numberStudents"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/myLabel"
/>
<Button
android:id="@+id/accept"
android:text="Accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/numberStudents"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
/>
<Button
android:id="@+id/cancel"
android:text="Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/accept"
android:layout_alignTop="@id/accept"
/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4938 次 |
| 最近记录: |