这个:
<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/