我试图在所有按钮下的画布上绘制形状。 下面的代码:Android:在视图上绘图画布不起作用
Paint paint = new Paint(); paint.setColor(R.color.Kolor); View view; LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.menu_glowne, null); Canvas can = new Canvas(Bitmap.createBitmap(300, 300, Bitmap.Config.ARGB_8888)); can.drawRect(0, 0, 200, 200, paint); setContentView(view); view.draw(can);
不知道为什么,我仍然没有得到画下任何布局。 关于我在做什么的任何想法都是错误的?
Thanx提前!
你能告诉我们什么ü正在尝试做一个快照。? – Ronnie