Ios 实现 滑动cell 伸缩的核心代码
2024-10-19 06:23:11
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat viewHeight = scrollView.height + scrollView.contentInset.top;
NSArray *cells = self.tableView.visibleCells;
for (int i = ; i < cells.count; i++) { UITableViewCell *cell = cells[i]; CGFloat y = cell.centerY - scrollView.contentOffset.y;
CGFloat p = y - viewHeight / ; CGFloat scale = cos(p / viewHeight * 0.8) * 0.85; [UIView animateWithDuration:0.15 delay: options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState animations:^{ cell.transform = CGAffineTransformMakeScale(scale, scale); } completion:^(BOOL finished) { }]; } }
最新文章
- StatePattern(状态模式)
- JavaScript练习之for循环语句
- 30秒修复Ubuntu菱形乱码问题
- Oracle GoldenGate Veridata 12.1.3已经发布
- 动态加载故事storyboard
- MediaPlayer简单使用,绑定surfaceView实现播放视频的功能
- WebService-06-CXF与Spring集成
- SVN解锁失败的解决办法
- jQuery进行简单验证的正则表达式
- 微信Token小识
- Yii2 数据库操作汇总
- VS2013开发上位机并调用MSCcommm控件的方式
- java访问权限表
- 搭建ssh框架项目(四)
- Redis与Zookeeper实现分布式锁的区别
- LeetCode: Largest Number 解题报告 以及Comparator, CompareTo 应用
- [Paper] Selection and replacement algorithm for memory performance improvement in Spark
- initrd in linux 2.6.32.27
- Network - Tips
- Potplayer快捷键