# RoundCircleLayout **Repository Path**: newki123456/RoundCircleLayout ## Basic Information - **Project Name**: RoundCircleLayout - **Description**: 可圆形可圆角可自定义圆角的自定义ViewGroup - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 39 - **Forks**: 5 - **Created**: 2022-09-17 - **Last Updated**: 2024-11-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## RoundCircleLayout 可以支持圆角与圆形裁剪的RoundCircleLayout。基于Outline与Shader实现,无需配置硬件加速,无兼容性问题。 1.0.1版本加入阴影的效果 依赖方法: ``` implementation "com.gitee.newki123456:round_circle_layout:1.0.1" ``` #### 如何使用: 自定义属性如下: ```xml ``` 属实是见名只意了。 在xml中使用如下: ```xml ``` 效果如下: ![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/434639cbc3514107a103866308d88232~tplv-k3u1fbpfcp-zoom-1.image) 同时也支持代码中设置: ```kotlin val layout_3 = findViewById(R.id.layout_3) findViewById(R.id.layout_2).setOnClickListener { val drawable = resources.getDrawable(R.drawable.chengxiao) it.background = drawable layout_3.background = drawable } ``` 效果: ![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8b037e40c18a48b9bf70a8617ca857ae~tplv-k3u1fbpfcp-zoom-1.image) 阴影的效果: ![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/e579ed805c534c5f840b566c95980907~tplv-k3u1fbpfcp-zoom-1.image) 具体的实现可以参考我的博客: https://juejin.cn/post/7145267096577343502