搜了好久..尝试了很多方法.

clean没用.

上段代码.

public Brick(Context context,AttributeSet attr) {
		super(context);
		this.setKeepScreenOn(true);
		brick = BitmapFactory.decodeResource(getResources(), R.drawable.brick);
		np = new NinePatch(brick, brick.getNinePatchChunk(), null);
		sfh = this.getHolder();
		sfh.addCallback(this);
		paint = new Paint();
		paint.setAntiAlias(true);
		paint.setColor(Color.WHITE);
		paint.setTextSize(25f);
//		setFocusable(true);
		
		
		TypedArray params = context.obtainStyledAttributes(attr,R.styleable.Brick);
		letter = new Letter(params.getString(R.styleable.Brick_english),params.getString(R.styleable.Brick_chinese));

就是这出问题鸟~~~~

要同时把 

AttributeSet 也传递给父类.
然后就OK了..

相关文章:

  • 2022-01-30
  • 2022-12-23
  • 2021-08-06
  • 2022-01-27
  • 2021-09-27
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-08
  • 2022-12-23
  • 2021-12-30
  • 2021-06-20
  • 2022-12-23
  • 2021-10-07
相关资源
相似解决方案