自定义属性 XML页面 调用 public Liushi(Context context, AttributeSet attrs) { super(context, attrs); TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.Liushi); color = array.getColor(R.styleable.Liushi_soucolor, 0); }