【发布时间】:2019-05-15 12:40:26
【问题描述】:
Android 资源编译失败 C:\Users\TTP\AndroidStudioProjects\TicCrossGame\app\src\main\res\layout\activity_main.xml:94:错误:标签不匹配。
我检查关闭标签但无法理解错误,因为我检查了所有关闭标签但仍然错误
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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">
<android.support.v7.widget.GridLayout
android:id="@+id/gridView"
android:layout_width="395dp"
android:layout_height="395dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="@drawable/grid"
app:columnCount="3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:rowCount="3" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="125dp"
android:layout_height="126dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
/>
<ImageView
android:id="@+id/imageView2"
android:layout_width="125dp"
android:layout_height="126dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:srcCompat="@drawable/cross" />
</android.support.v7.widget.GridLayout>
</android.support.v7.widget.GridLayout>
</android.support.constraint.ConstraintLayout>
【问题讨论】:
-
删除重复的结束标签
-
问题是你关闭了两次GridLayout标签,无论如何,你能描述一下你希望你的布局是什么样子吗?可能有更好的方法而不是使用 GridLayout
标签: java android android-layout