支付宝首页collectionCell点击闪动效果实现
来源:互联网 发布:爱另类软件 编辑:程序博客网 时间:2024/05/18 12:05
问题描述
点击cell的时候,让cell里面的透明度降低,松开手指透明度恢复。
类似支付那样
实现方法
重写UIResponder的touchesBegan和touchesEnded
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ [super touchesBegan:touches withEvent:event]; [UIView animateWithDuration:0.5 animations:^{ self.topViewImg.alpha = 0.7; self.bottomlable.alpha = 0.7; }];}-(void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ [UIView animateWithDuration:0.5 animations:^{ self.topViewImg.alpha = 1; self.bottomlable.alpha = 1; }]; [super touchesEnded:touches withEvent:event];}
效果图
拓展
因为touchesBegan和touchesEnded是uiview的父类的方法,所以所有的view都可以实现这种效果。
估计uibutton点击闪动效果也是这样实现的
2 0
- 支付宝首页collectionCell点击闪动效果实现
- android实现类似于支付宝余额快速闪动的效果
- android实现类似于支付宝余额快速闪动的效果
- android实现类似于支付宝余额快速闪动的效果
- android实现类似于支付宝余额快速闪动的效果
- 8.3.7 实现闪动效果
- TextView实现彩色闪动效果
- 仿支付宝首页体验效果(Swift版本)
- XZ_iOS之点击按钮调起支付宝到支付宝首页
- 支付宝首页刷新
- 类似支付宝的view点击效果透明度变化
- 仿携程首页缩放的点击效果
- 实现类似金山点击首页内存清理后跳转到内存页面效果
- 教你如何在GridView的Item中实现“仿携程首页的按钮”点击缩放效果
- 仿支付宝首页(更多)添加、删除、拖拽、点击等功能
- 实现支付宝支付从底部弹窗效果
- 使用DialogFragment实现支付宝支付从底部弹出效果
- 实现支付宝支付从底部弹窗效果
- which -find
- sigmoid和softmax函数的C++实现
- python 实现简单监控 windows版
- 设散列函数为H(k)=K MOD 13,给定的键值序列为13,41,15,44,06,68,12,25,38,64,19,49
- ProgressBar 进度条
- 支付宝首页collectionCell点击闪动效果实现
- 欢迎使用CSDN-markdown编辑器
- 《C++ Primer 第六版》第二章
- excel导出工具类(包含合并单元格)
- BMP文件格式详解(BMP file format)
- 内连接、左外连接、右外连接、交叉连接区别(图解)
- 监听tomcat服务器启动/关闭并从配置文件中读取参数进行初始化
- 线程demo
- struts2中struts.xml配置文件详解