<少女> 2022-11-16 15:31 采纳率: 90.9%
浏览 1
已结题

为什么在这里显示我报错啊?我这个id都没有重复过,为什么还报错哦?而且我想给checkbox写text,写在string里面,也显示我报错?


<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="20dp"
            android:text="@string/text">
        </TextView>
        <RadioGroup
            android:id="@+id/rg1"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
           <RadioButton
               android:id="@+id/rt1"
               android:text="@string/btn1"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content">
           </RadioButton>
            <RadioButton
                android:id="@+id/rt2"
                android:text="@string/btn2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
            </RadioButton>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
            <TextView
                android:text="请选择你的兴趣爱好:"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
            </TextView>
                <CheckBox
                    android:id="@+id/checkbox1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="英语"/>
                <CheckBox
                    android:id="@+id/checkbox2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="数学"/>
                <CheckBox
                    android:id="@+id/checkbox3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="语文"/>
            </LinearLayout>
    <Button
        android:id="@+id/btn1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/login" />
        </RadioGroup>
    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

img

img

为什么在这里显示我报错啊?我这个id都没有重复过,为什么还报错哦?而且我想给checkbox写text,写在string里面,也显示我报错?

  • 写回答

1条回答 默认 最新

  • Plantago 2022-11-16 15:43
    关注

    代码有问题,都不是正常的标签结尾

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 11月24日
  • 已采纳回答 11月16日
  • 创建了问题 11月16日

悬赏问题

  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计