drawRoundRect not showing rounded corners or nothing at all
The following code snippet draws a red rectangle:
RectF rectangle = new RectF(50, 100, 100, 50);
Paint paint = new Paint();
paint.setColor(Color.RED);
ca开发者_如何学Gonvas.drawRoundRect(rectangle, 0, 0, paint);
However if i change rx and ry both to a positive value, say 5, than nothing is shown. Any ideas?
Your rectangle definition is incorrect. The parameters of a RectF are left, top, right and bottom, not x, y, width and height. Try with 50, 100, 150, 150 for instance.
精彩评论