gpt4 book ai didi

java - 解析 XML 时出错 : not well-formed (invalid token) and all R's in red

转载 作者:太空宇宙 更新时间:2023-11-04 12:27:41 24 4
gpt4 key购买 nike

    <?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >

<TextView
android:="@+id/question_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="24dp"
android:id="@+id/textView" />


<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<Button
android:id="@+id/true_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/true_button" />

<Button
android:id="@+id/false_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/false_button" />

</LinearLayout>


<Button
android:id="@+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next_button" />

</LinearLayout>

在java主类中,所有“R”都显示为红色,并且他们说“无法解析符号'R'”,所有标签都在xml中关闭,所以我真的不知道是什么导致了问题。

最佳答案

TextView 节点中的第一个属性必须有一个名称,现在它只有 namespace android
仔细查看字符串:

android:="@+id/question_text_view"

关于java - 解析 XML 时出错 : not well-formed (invalid token) and all R's in red,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38190556/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com