当前位置:网站首页>ConstraintLayout官方提供圆角ImageFilterView
ConstraintLayout官方提供圆角ImageFilterView
2022-07-05 09:41:00 【沙漠一只雕得儿得儿】
圆角ImageFilterView,ImageFilterButton
印象中这应该是第一次官方提供具有圆角功能的view了吧,除了圆角功能外,ImageFilterView,ImageFilterButton还有一堆其他的功能。
- 圆角
app:round,取值0-50dp,默认0,就是方形,设置50就是圆形图片,超过50没其他意义,还是圆形图片。 - 圆角比例
app:roundPercent,取值0-1之间,默认0就是方形,1是圆形图片,同上,超过1按照1处理,还是圆形图片。 - 交叉图
app:altSrc,需要跟app:crossfade共同使用,app:crossfade取值0-1,默认0为交叉图完全透明,不展示。取值1交叉图完全展示,覆盖到src上。app:overlay,官方释义:定义alt图像是在原始图像的顶部淡入,还是与其交叉淡入。默认值为true。对于半透明对象设置为false。我没试过效果。 - 色温
app:warmt,float型,默认值1,小于1是冷色调,大于1是暖色调。 - 亮度
app:brightness,float型,默认1,值越大亮度越高。 - 饱和度
app:brightness,float型,默认1,取值0为灰阶样式,大于1的数值都是超饱和状态,色彩非常艳丽,有点辣眼睛。 - 对比度
app:contrast,float型,默认1,取值0相当于图片变全黑,大于1都是高对比度状态。
<?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:orientation="vertical">
<androidx.constraintlayout.utils.widget.ImageFilterView
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/ic_launcher_background"
app:roundPercent="1" />
</LinearLayout>使用效果:

边栏推荐
- 一个程序员的职业生涯到底该怎么规划?
- Dedecms website building tutorial
- 卷起來,突破35歲焦慮,動畫演示CPU記錄函數調用過程
- TypeError: Cannot read properties of undefined (reading ‘cancelToken‘)
- 盗版DALL·E成梗图之王?日产5万张图像,挤爆抱抱脸服务器,OpenAI勒令改名
- 天龙八部TLBB系列 - 关于技能冷却和攻击范围数量的问题
- View Slide
- 一种用于干式脑电图的高密度256通道电极帽
- La voie de l'évolution du système intelligent d'inspection et d'ordonnancement des petites procédures de Baidu
- 面试:List 如何根据对象的属性去重?
猜你喜欢

How to get the STW (pause) time of GC (garbage collector)?

程序员如何活成自己喜欢的模样?

Swift tableview style (I) system basic

The comparison of every() and some() in JS uses a power storage plan

Tdengine already supports the industrial Intel edge insight package

一种用于干式脑电图的高密度256通道电极帽

钉钉、企微、飞书学会赚钱了吗?

Why don't you recommend using products like mongodb to replace time series databases?

Implementation of smart home project

Apache DolphinScheduler 入门(一篇就够了)
随机推荐
Openes version query
卷起來,突破35歲焦慮,動畫演示CPU記錄函數調用過程
Fluent generates icon prompt logo widget
Wechat applet - simple diet recommendation (2)
解决idea调试过程中liquibase – Waiting for changelog lock….导致数据库死锁问题
Matrix processing practice
善用兵者,藏于无形,90 分钟深度讲解最佳推广价值作品
天龙八部TLBB系列 - 关于包裹掉落的物品
Unity particle special effects series - the poison spray preform is ready, and the unitypackage package can be used directly - next
Solve the problem of no all pattern found during Navicat activation and registration
Six simple cases of QT
Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 -下
驱动制造业产业升级新思路的领域知识网络,什么来头?
Optimize database queries using the cursor object of SQLite
To bring Euler's innovation to the world, SUSE should be the guide
Fluent development: setting method of left and right alignment of child controls in row
90%的人都不懂的泛型,泛型的缺陷和应用场景
如何写出高质量的代码?
Small program startup performance optimization practice
The Alipay in place function can't be found, and the Alipay in place function is offline