圆角Imageview
来源:互联网 发布:博优软件官网 编辑:程序博客网 时间:2024/06/03 20:04
001.也是项目需求,我们的UI妹子设计了圆角图片,我开始准备自定义结果自己能力有限废了好大劲还没达到效果,之后就去搜索,开源强大,还真简单实现图片圆角
002.cardview简单实现图片圆角处理:cardview是Android5.0出的一个新控件,直接包裹一个Imageview实现圆角
添加依赖:
compile 'com.android.support:cardview-v7:25.3.1'
xml代码如下,就可以直接运行看效果
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v7.widget.CardView android:id="@+id/cv" android:layout_width="match_parent" android:layout_height="200dp" android:layout_margin="10dp" app:cardElevation="3dp" app:cardCornerRadius="18dp"> <ImageView android:id="@+id/fragment_home_info_item_img" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" android:src="@drawable/abc" /> </android.support.v7.widget.CardView></LinearLayout>
属性设置:
- CardView_cardBackgroundColor 设置背景色
- CardView_cardCornerRadius 设置圆角大小
- CardView_cardElevation 设置z轴阴影
- CardView_cardMaxElevation 设置z轴最大高度值
- CardView_cardUseCompatPadding 是否使用CompadPadding
- CardView_cardPreventCornerOverlap 是否使用PreventCornerOverlap
- CardView_contentPadding 内容的padding
- CardView_contentPaddingLeft 内容的左padding
- CardView_contentPaddingTop 内容的上padding
- CardView_contentPaddingRight 内容的右padding
- CardView_contentPaddingBottom 内容的底padding
大家可以根据自己需求扩展!!
003.github圆角神器:github圆角链接
阅读全文
0 0
- 圆角ImageView
- 圆角imageview
- ImageView圆角
- ImageView圆角
- 圆角ImageView
- 圆角Imageview
- 圆角ImageView
- Android 圆角ImageView
- 圆形 圆角ImageView
- Android:圆角ImageView
- 自定义ImageView 圆角shape
- 圆角Imageview--RoundedImageView
- 处理imageView圆角
- android自定义 圆角Imageview
- Android 圆角ImageView
- 自定义View圆角ImageView
- 自定义View圆角ImageView
- ImageView
- 8.存储模型2——虚拟存储技术
- windows下添加静态路由
- datacleaner第三部分,八、九、十章
- UdpClient(数据报)
- 最新版AndroidStudio3.0 Canary 8的时候报错,Annotation processors must be explicitly declared now
- 圆角Imageview
- 设计模式之访问者模式
- java jdk工具类中UUID的使用
- c# 枚举
- Redis安装 centOS单机版
- (my)eclipse 快捷键
- js代码转vue
- Html5和CSS3补充
- Mybatis 自动驼峰命名映射