Custom view * is not using the 2- or 3-argument View constructors; XML attributes will not work
写三个构造函数就OK了:
public class ExtendedClass extends Button {
public ExtendedClass(Context context) {super( context, attrs );}public ExtendedClass(Context context, AttributeSet attrs) {super( context, attrs );}public ExtendedClass(Context context, AttributeSet attrs, int defStyle) {super( context, attrs, defStyle );}}
浙公网安备 33010602011771号