自定义cell
2015-10-15 23:07
369 查看
//
// TableViewCell.m
// TableView
//
// Created by Bruce on 15/8/25.
// Copyright (c) 2015年 Bruce. All rights reserved.
//
#import "TableViewCell.h"
#import "Canvas.h"
@implementation TableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
CSAnimationView *animationView = [[CSAnimationView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
animationView.backgroundColor = [UIColor whiteColor];
animationView.duration = 0.5;
animationView.delay = 0;
animationView.type = CSAnimationTypeShake;
[self.contentView addSubview:animationView];
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(10, 0, 40, 40)];
view.backgroundColor = [UIColor brownColor];
[animationView addSubview:view];
[animationView startCanvasAnimation];
}
return self;
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
// TableViewCell.m
// TableView
//
// Created by Bruce on 15/8/25.
// Copyright (c) 2015年 Bruce. All rights reserved.
//
#import "TableViewCell.h"
#import "Canvas.h"
@implementation TableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
CSAnimationView *animationView = [[CSAnimationView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
animationView.backgroundColor = [UIColor whiteColor];
animationView.duration = 0.5;
animationView.delay = 0;
animationView.type = CSAnimationTypeShake;
[self.contentView addSubview:animationView];
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(10, 0, 40, 40)];
view.backgroundColor = [UIColor brownColor];
[animationView addSubview:view];
[animationView startCanvasAnimation];
}
return self;
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
相关文章推荐
- 连载《一个程序猿的生命周期》- 39、年底,历时一个月找工作,无奈中前行
- 迅雷校招 面试经历
- Machine Learning 20151015
- 中断
- C 常用库函数memset,编译器宏定义assert
- 华为交换机ACL配置的一些东西
- 在.net中使用GAC
- surfaceView
- WEB技术之四层架构
- IOS学习笔记-perFormSelector,RunLoop,Debug神器,UIResponder,Cocoa Touch事件处理
- C# 中引用类型和 值类型
- 【一些事晚报】iPhone6s港台退货潮
- u盘安装centos7
- Linux安装gcc编译器详解(CentOS 6.6 64位系统)
- CoreData(数据持久化的方式)
- java Webservice(一)HttpClient使用(二)
- leetcode之Contains Duplicate
- c++拷贝文件
- Python虚拟环境学习
- 逻辑回归(Logistic Regression)