当前位置:网站首页>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>使用效果:

边栏推荐
- QT timer realizes dynamic display of pictures
- How to use sqlcipher tool to decrypt encrypted database under Windows system
- Wechat applet - simple diet recommendation (2)
- ThreadLocal source code learning
- Coordinate system of view
- 自动化规范检查软件如何发展而来?
- Idea debugs com intellij. rt.debugger. agent. Captureagent, which makes debugging impossible
- Cent7 Oracle database installation error
- 剪掉ImageNet 20%数据量,模型性能不下降!Meta斯坦福等提出新方法,用知识蒸馏给数据集瘦身...
- Swift uses userdefaults and codable to save an array of class objects or structure instances
猜你喜欢

MySQL character type learning notes

双容水箱液位模糊PID控制系统设计与仿真(Matlab/Simulink)

解决idea调试过程中liquibase – Waiting for changelog lock….导致数据库死锁问题

H. 265 introduction to coding principles

.Net之延迟队列

让AI替企业做复杂决策真的靠谱吗?参与直播,斯坦福博士来分享他的选择|量子位·视点...

《微信小程序-基础篇》小程序中的事件与冒泡

Cross process communication Aidl

Implementation of smart home project

Idea debugs com intellij. rt.debugger. agent. Captureagent, which makes debugging impossible
随机推荐
Single chip microcomputer principle and Interface Technology (esp8266/esp32) machine human draft
Energy momentum: how to achieve carbon neutralization in the power industry?
【小技巧】获取matlab中cdfplot函数的x轴,y轴的数值
Fluent generates icon prompt logo widget
Apache DolphinScheduler 系统架构设计
Design and Simulation of fuzzy PID control system for liquid level of double tank (matlab/simulink)
钉钉、企微、飞书学会赚钱了吗?
Mysql80 service does not start
RMS to EAP is simply implemented through mqtt
C#函数返回多个值方法
Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
Tianlong Babu TLBB series - about items dropped from packages
【OpenCV 例程200篇】219. 添加数字水印(盲水印)
让AI替企业做复杂决策真的靠谱吗?参与直播,斯坦福博士来分享他的选择|量子位·视点...
剪掉ImageNet 20%数据量,模型性能不下降!Meta斯坦福等提出新方法,用知识蒸馏给数据集瘦身...
解决idea调试过程中liquibase – Waiting for changelog lock….导致数据库死锁问题
《剑来》语句摘录(七)
Cross process communication Aidl
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 - 上