I have a round corners layout, now I want to add a child view (an Imageview) which matches the parent layout's height and width.
My problem is that the child view hides the round corners of the parent.
How can I constrain it inside the borders of the parent layout without using the margin property, so that the parent's round corners stay visible?
PS: I created round corners of parent layout by overriding the onDraw()
method.
My code:
protected void onDraw(Canvas canvas) {
canvas.drawRect(0, 0, width, height, mpaint);
super.onDraw(canvas);
}