这只是缺少了一种构造方法: public HandleView(Context context, AttributeSet attrs) { this(context, attrs, 0); } 在重写的View中加上这个构造函数即可。