使用isInEditMode解决可视化编辑器没法识别自定义控件的问题

若是在自定义控件的构造函数或者其余绘制相关地方使用系统依赖的代码,编辑器

会致使可视化编辑器没法报错并提示:Use View.isInEditMode() in your custom views to skip code when shown in Eclipse函数

if(!isInEditMode()){
//形成错误的代码段
}code

相关文章
相关标签/搜索