Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个需要绘制一些矩形并使用它的contains()方法的小应用程序。我的问题是绘制一个隐藏的矩形。我正在尝试使用Paint's setStyle(Paint.Style.STROKE),then setStrokeWidth(0)。但中风仍然可见。
contains()
setStyle(Paint.Style.STROKE),
setStrokeWidth(0)
将油漆颜色设置为透明色。试试下面
Paint paint = new Paint(); paint.setColor(0xFF); OR paint.setColor(Color.TRANSPARENT); canvas.drawRect(30, 30, 80, 80, paint);