4
protected void onDraw(Canvas canvas) {
            float width = canvas.getWidth();
            float height = canvas.getHeight();
            Path path = new Path();
            path.addArc(new RectF(0, 0, width, height), 90, 180);
            canvas.clipPath(path);
            Paint paint = new Paint();
            paint.setAntiAlias(true);
            paint.setColor(Color.RED);
            canvas.drawRect(new RectF(0, 0, width, height), paint);
}

I use this code to override other views; it's ok(show a semicircle); but when I use this to override FrameLayout, show me a rectangle?!

Why? How can I modify it?

krishna
  • 4,069
  • 2
  • 29
  • 56
  • 2
    http://stackoverflow.com/questions/7781892/own-defined-layout-ondraw-method-not-getting-called you can find answer from this post – Gaopeng Dec 19 '13 at 06:32

0 Answers0