android 的relativelayout 报错 No resource found that matches the given name

android 的relativelayout 报错

error: Error: No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/
main_auto_checkbox').

后来才发现是我在A中引用了B的id,但是B的id是在后面声明的,编译器是顺序执行的(在我看来),因此找不到,当我把B的声明放在A的前面,就ok了,

	
				
				
			


,更换checkbox和textview的声明顺序,这个样子就对了

			
				
				
			




你可能感兴趣的:(android 的relativelayout 报错 No resource found that matches the given name)