The resource or ID exists, but when compiling and running, an error is reported that the resource cannot be found. The problem is solved. No resource found that matches the given name

/layout/dk_dialog_errornotice.xml:16:38-60: AAPT: No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/bd_notice_toptitle').

After finding the id location in the error report, it was found that it existed and was not lost, but the system said it could not be found. Look at the code below:

 

Let the View be on the left side of the TextView, but the View cannot find the id bd_notice_toptitle when it is recognized. Later, I try to write the TextView to the front, and the id bd_notice_toptitle will be recognized first during compilation. The problem is solved:

 

Guess you like

Origin blog.csdn.net/zhao8856234/article/details/116991467