更新时间:2023-11-19 11:03:46
您错过了一个构造函数,
you missed a constructor,
public surfaceviewclass (Context context, AttributeSet attrs) {
super(context, attrs);
}
编辑:
这是当视图被充气时调用构造函数从XML(构造)。你声明的属性由第二个参数提供
This is the constructor that is called when the view is inflated (constructed) from the xml. The attributes you declared are supplied by the second parameter