【发布时间】:2012-05-16 21:21:56
【问题描述】:
我正在开发油漆应用程序,我将布局背景设置为白色,并将油漆颜色设置为黑色。但是,在画布中我得到透明的黑色,我希望它是画布油漆的深色。
我的输出如下截图:
我的代码如下:
public DrawView(Context context){
super(context);
setFocusable(true);
setFocusableInTouchMode(true);
this.setOnTouchListener(this);
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setDither(true);
mPaint.setColor(0x80808080);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setStrokeWidth(6);
mCanvas = new Canvas();
mPath = new Path();
paths.add(mPath);
}
【问题讨论】:
-
非常感谢您解决了我的问题
-
你应该 accept answer 这对你有帮助。
-
你应该选择this
标签: android