No resource found that matches the given name (at 'xxx' with value '@id/xxx')解决方式

布满荆棘的人生 2021-11-10 06:01 354阅读 0赞

问题描述

error: Error: No resource found that matches the given name (at ‘layout_constraintRight_toLeftOf’ with value ‘@id/total_time_tv’).

提示是资源的ID无法引用

解决方式

将声明@+id/view_id的控件

放置在引用他的控件之前

例如:

  1. <!--先声明-->
  2. <TextView android:id="@+id/tv_id" android:layout_width="wrap_content" android:layout_height="wrap_content" />
  3. <!--再引用-->
  4. <TextView app:layout_constraintTop_toBottomOf="@id/tv_id" android:id="@+id/tv_id" android:layout_width="wrap_content" android:layout_height="wrap_content" />

发表评论

表情:
评论列表 (有 0 条评论,354人围观)

还没有评论,来说两句吧...

相关阅读