<少女> 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 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示