开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜