Custom Layout that rounds the corners of its content

后端 未结 7 2054
北海茫月
北海茫月 2020-11-29 04:08

I would like to create a generic ViewGroup which can then be reused in XML layouts to round the corners of anything that is put into it.

For some reason canvas

7条回答
  •  执念已碎
    2020-11-29 04:54

    Why not just define a ShapeDrawable as the background of your layout and just change the corner radius of the drawable at runtime.

提交回复
热议问题