提问者:小点点

我从git拉到Android Studio时会收到警告


我上传了一个非常简单合法的代码,它是正确的,但是当我从另一台计算机中提取时,XML文件被着色为红色两台计算机都具有相同版本的软件所有以

Android系统,

app:布局,

工具:…是红色的

<?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">

    <TextView
        android:id="@+id/textView"
        android:layout_width="250dp"
        android:layout_height="69dp"
        android:textSize="34sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.809" />

</androidx.constraintlayout.widget.ConstraintLayout>

共1个答案

匿名用户

删除所有名称空间,然后再次添加。它对我有用。

如果不起作用,请尝试使缓存无效/重新启动