Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
众所周知,当 Eclipse 必须在 XML 图形布局中显示组件时,它会调用组件的构造函数,因此它知道组件的外观。
如果调用是针对设计时(以上情况)或实际运行时进行的,我如何检查构造函数调用?
我想你正在寻找View.isInEditMode()
View.isInEditMode()