problems with Android FrameLayout when override onDraw

view story

http://stackoverflow.com – 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? Ho (HowTos)