android - 找不到与给定名称匹配的资源(在 'layout_alignTop' 处,值为 '@id/imageView3' )

标签 android manifest

这个:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity"
android:weightSum="1">

<ImageView
    android:id="@+id/imageView2"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:layout_alignTop="@id/imageView3"
    android:layout_toLeftOf="@id/imageView3"
    android:layout_marginRight="30dp"/>



<ImageView
    android:id="@+id/imageView3"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:layout_gravity="center_horizontal"
    android:layout_marginTop="30dp"
    android:layout_centerHorizontal="true"/>

<ImageView
    android:id="@+id/imageView4"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:layout_alignTop="@id/imageView3"
    android:layout_toRightOf="@id/imageView3"
    android:layout_marginLeft="30dp"/>

</RelativeLayout>

是我的 AndroidManifest.xml,我收到错误:

错误:(77, 35) 找不到与给定名称匹配的资源(在“layout_alignTop”上的值为“@id/imageView3”)。

错误:(78, 35) 未找到与给定名称匹配的资源(在“layout_toLeftOf”中值为“@id/imageView3”)。

最佳答案

您可以使用 .首先添加+符号。

 android:layout_alignTop="@+id/imageView3"

之后,Clean-Rebuild-Restart 您的 IDE

关于android - 找不到与给定名称匹配的资源(在 'layout_alignTop' 处,值为 '@id/imageView3' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34585145/

相关文章:

java - Android/Java - ListView 使用 ArrayList 填充 XML 数据 : Only Displays First Item

Android 11. ContentResolver.query 返回空游标

安卓工作室 : INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

Android 辅助服务 - 清除 EditText

android - 是否可以将代码包含/导入到 Android list 中?

android - 无法解析符号 Manifest.permission.READ_PHONE_STATE

java - 是否可以在 java Manifest 文件中使用 SHA1-Digest 而无需实际使用 key

Android – 什么是 Google Play 控制台预启动报告错误 4000004?

android - 循环遍历Android View 的所有 subview ?

android - 为什么自定义首选项的字体更大?