CircleImageView 设置无边框
来源:互联网 发布:数控精雕机编程 编辑:程序博客网 时间:2024/05/03 19:01
CircleImageView学习
在不需要边框时设置如下:
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/profile_image" android:layout_width="96dp" android:layout_height="96dp" android:src="@drawable/profile" app:civ_border_width="0dp" app:civ_border_color="#FF000000"/>
并注释掉
de.hdodenhof.circleimageview.CircleImageView代码中
@Override protected void onDraw(Canvas canvas) { if (getDrawable() == null) { return; } canvas.drawCircle(getWidth() / 2, getHeight() / 2, mDrawableRadius, mBitmapPaint); //canvas.drawCircle(getWidth() / 2, getHeight() / 2, mBorderRadius, mBorderPaint);注释掉 }
解释:app:civ_border_wdith="0dp" 只是设置圆形图片的边框大小,即环宽(边框相当于一个圆环)
当环宽为0时,是不应该绘制的,但是github代码中仍然在图片最外围描了下边,故应该注释掉onDraw中的代码
github地址 https://github.com/hdodenhof/CircleImageView
0 0
- CircleImageView 设置无边框
- 设置UltraWebTab无边框
- 设置iframe无边框
- 设置QLineEdit无边框
- 无边框表格设置
- wpf设置窗体边框为无边框
- 设置无边框全屏窗口
- 设置窗体无边框属性
- Android设置edittext无边框
- 设置html表格无边框
- Qt 设置窗体无边框
- css 设置text无边框 无自动提醒 无颜色
- 项目实践之iframe无边框设置
- Delphi 设置窗体无标题栏和边框
- 为无边框窗口设置阴影效果
- C# WPF 设置窗口无边框
- 按钮 无边框 相关css设置
- 设置QLineEdit无边框且透明
- xml文件 数据库 字符转译f
- 实现N的N次方求其最高位数字
- UML关系
- myeclipse非正常关闭处理办法
- Linux 查找两个文件的不同
- CircleImageView 设置无边框
- js setInterVal()实时显示时间、日期
- Makefile常用调试方法
- eclipse中将maven工程变成普通的web工程,添加到tomcat
- Facebook面试题 Moving positive, negative and zeros in an array
- Yii2中如何使用CodeCeption
- 安装和使用Google perftools
- Hadoop启动、作业提交及错误修改
- SharePoint2013简单部署