[英]Android Custom Layout have trouble in layout xml file with design mode
I extend ConstraintLayout class for special purpose. 我出于特殊目的扩展了ConstraintLayout类。
and I use this class in layout xml file. 我在布局xml文件中使用此类。
not problem show layout.xml with text mode. 没问题,以文本模式显示layout.xml。
but try show layout.xml with Design mode, android studio show me this message. 但是尝试在设计模式下显示show layout.xml,android studio会向我显示此消息。
I already try 'Refresh', 'rebuild', 'clean build'. 我已经尝试过“刷新”,“重建”,“干净构建”。
but still show 'Missing classes'. 但仍显示“缺少课程”。
how can I fix this problem? 我该如何解决这个问题?
The problem is that you are referencing to a class that doesn't exist or is not where you are referencing to. 问题是您要引用的类不存在或不在您要引用的地方。
You can either fix the path by 您可以通过以下方式固定路径
Copying the class to the correct folder. 将类复制到正确的文件夹。
Fixing the path by clicking on Fix build path
通过单击Fix build path
来Fix build path
Or, click on Create Class
and copy everything you had in previous class into the new one. 或者,单击“ Create Class
,然后将上一Create Class
所有内容复制到新课程中。
I think the 3rd option will be the easiest for you. 我认为第三个选择对您来说最简单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.