iOS:UITableView实现飘带动画
来源:互联网 发布:手机淘宝无法安装 编辑:程序博客网 时间:2024/06/06 08:23
UITableView实现飘带动画,是利用tableView的reloadData方法,在加载UITableViewCell时改变cell.textLabel
的位置。具体实现如下:
// 设置动画[从左到右飘]__block CGRect frame = cell.textLabel.frame;// 最左边frame.origin = CGPointMake(-tableView.bounds.size.width/2, 0);cell.textLabel.frame = frame;[UIView animateWithDuration:0.5*(1+(double)indexPath.row/4) animations:^{ // 中间 frame.origin = CGPointMake(tableView.bounds.size.width/2, 0); cell.textLabel.frame = frame; } completion:^(BOOL finished) { [UIView animateWithDuration:0.5*(1+(double)indexPath.row/4) delay:2.0 // 停留2秒 options:UIViewAnimationOptionCurveEaseInOut animations:^{ // 最右边 frame.origin = CGPointMake(tableView.bounds.size.width, 0); cell.textLabel.frame = frame; } completion:^(BOOL finished) { if (indexPath.row == 3) { // 动画结束,从头开始 [tableView reloadData]; } }];}];
阅读全文
0 0
- iOS:UITableView实现飘带动画
- iOS 底层实现 - UITableView
- iOS UITableView reloadData刷新的动画
- UITableView beginUpdates和endUpdates-实现UITableView的动画块
- [UITableView]beginUpdates和endUpdates - 实现UITableView的动画块
- iOS纯Autolayout实现UITableView的二级分类下拉菜单展开动画,Autolayout真的快的飞起
- iOS 动画实现
- animation iOS实现动画
- iOS时钟动画实现
- ios弹簧动画实现
- iOS 动画的实现
- iOS开发~为UITableView的reloadData方法添加动画
- IOS之UITableView划动删除的实现
- ios UITableView表格实现搜索栏搜索
- IOS UITableView -- 实现类QQ主界面
- IOS 如何实现UITableView的划动删除
- IOS UITableView Section下拉列表实现
- [iOS]UITableView实现简单瀑布流
- 关于Halcon基于特征点图像拼接的算子实现
- 设计模式的艺术之道--原型模式
- Android4.4高通平台中的应用路径及应用裁剪方法
- getComputedStyle 使用方法
- 通过getSystemServices获取手机管理大全
- iOS:UITableView实现飘带动画
- Maven的使用(Myeclipse)
- 通过递增快照备份 Azure 非托管 VM 磁盘
- Java集合总结之Collection整体框架
- Tomcat 架构分析(一) 体系结构
- onnx on OSX
- Median of Two Sorted Arrays
- Linux的内核相关问题
- Leetcode个人题解14