给tableview Cell添加动画(两种实现方法 效果还不错)
来源:互联网 发布:卓鸿网络 编辑:程序博客网 时间:2024/05/16 17:41
TableViewController有一个代理方法就是下面的方法
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath
*)indexPath{
//第一种效果
#pragma mark - UITableView delegate methods
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
/*
CGFloat rotationAngleDegrees = 0;
CGFloat rotationAngleRadians = rotationAngleDegrees * (M_PI/180);
CGPoint offsetPositioning = CGPointMake(-200, -20);
CATransform3D transform = CATransform3DIdentity;
transform = CATransform3DRotate(transform, rotationAngleRadians, 0.0, 0.0, 1.0);
transform = CATransform3DTranslate(transform, offsetPositioning.x, offsetPositioning.y, 0.0);
UIView *card = [cell contentView];
card.layer.transform = transform;
card.layer.opacity = 1;
[UIView animateWithDuration:0.8f animations:^{
card.layer.transform = CATransform3DIdentity;
card.layer.opacity = 1;
}];
*/
//第二种效果
CATransform3D transform; transform = CATransform3DMakeRotation( (90.0*M_PI)/180, 0.0, 0.7, 0.4); transform.m34 = 1.0/ -600;
// 2. 定义cell的初始状态
cell.layer.shadowColor = [[UIColor blackColor]CGColor];
cell.layer.shadowOffset = CGSizeMake(10, 10);
cell.alpha = 0;
cell.layer.transform = transform;
cell.layer.anchorPoint = CGPointMake(0, 0.5);
// 3. 定义cell的最终状态,并提交动画
[UIView beginAnimations:@"transform" context:NULL];
[UIView setAnimationDuration:0.5];
cell.layer.transform = CATransform3DIdentity;
cell.alpha = 1;
cell.layer.shadowOffset = CGSizeMake(0, 0);
cell.frame = CGRectMake(0, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height);
[UIView commitAnimations];
} 0 0
- 给tableview Cell添加动画(两种实现方法 效果还不错)
- 给TableView Cell 添加动画
- 给tableview cell添加动画
- 给TableView添加一点动画效果
- 给TableView或者CollectionView的cell添加简单动画
- 给TableView或者CollectionView的cell添加动画
- 给tableview cell添加阴影:
- 给cell添加动画
- 去除tableview cell起始15pt的两种方法
- UITableView的cell的两种动画效果。
- iOS开发-给TableView或者CollectionView的cell添加简单动画,很方便,直接粘代码即可
- 给UITableview cell添加出场动画
- iOS开发 给cell添加动画
- [iOS]在tableview中用动画效果改变cell的高度
- 在tableview中用动画效果改变cell的高度
- tableview中用动画效果改变cell的高度
- 给控件添加动画效果
- 给ListView添加动画效果
- 第十二周项目-阅读程序
- jQuery获取Select选择的Text和Value
- HTTP中的keepalive(长连接)
- MFC笔记:GDI+贴图、双缓冲绘图、向屏幕上输出文字
- Linux - Vsftp之安装和配置
- 给tableview Cell添加动画(两种实现方法 效果还不错)
- SrcExpl 插件实现自动显示跳转函数及变量定义功能
- cURL简单使用、libcurl编程, curl_easy_setopt
- Delphi XE5 for Android (一)
- C Primer Plus(第五版)学习(一)
- 第十二周项目-阅读程序
- apt-get命令简单记录
- linux环境变量
- Delphi XE5 for Android (二)