横向头像布局
2016-02-15 11:26
267 查看
@interface
ViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,strong)UITableView *tableView;
@end
@implementation ViewController
- (void)viewDidLoad {
[super
viewDidLoad];
self.view.backgroundColor =[UIColor
whiteColor];
_tableView =[[UITableView
alloc]initWithFrame:CGRectMake(0,
0, 320,
50)style:UITableViewStylePlain];
//_tableView.center =self.view.center;
_tableView.delegate =
self;
_tableView.dataSource =self;
_tableView.transform =CGAffineTransformMakeRotation(-M_PI
/2);
_tableView.showsVerticalScrollIndicator =
NO;
[self.view
addSubview:_tableView];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
*)indexPath
{
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:@"identifier"];
if (cell == nil) {
cell = [[UITableViewCell
alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"identifier"];
cell.backgroundColor =[UIColor
redColor];
// cell顺时针旋转90度
cell.contentView.transform =
CGAffineTransformMakeRotation(M_PI /
2);
}
return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath
*)indexPath
{
return 50;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 5;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 10;
}
ViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,strong)UITableView *tableView;
@end
@implementation ViewController
- (void)viewDidLoad {
[super
viewDidLoad];
self.view.backgroundColor =[UIColor
whiteColor];
_tableView =[[UITableView
alloc]initWithFrame:CGRectMake(0,
0, 320,
50)style:UITableViewStylePlain];
//_tableView.center =self.view.center;
_tableView.delegate =
self;
_tableView.dataSource =self;
_tableView.transform =CGAffineTransformMakeRotation(-M_PI
/2);
_tableView.showsVerticalScrollIndicator =
NO;
[self.view
addSubview:_tableView];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
*)indexPath
{
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:@"identifier"];
if (cell == nil) {
cell = [[UITableViewCell
alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"identifier"];
cell.backgroundColor =[UIColor
redColor];
// cell顺时针旋转90度
cell.contentView.transform =
CGAffineTransformMakeRotation(M_PI /
2);
}
return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath
*)indexPath
{
return 50;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 5;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 10;
}
相关文章推荐
- rocketmq3.26研究之一存储层
- 快速掌握Lua 5.3 —— "Weak Tables"以及数学库
- MyBatis foreach标签循环迭代集合对象实现批量删除
- Selenium WebDriver中一些鼠标和键盘事件的使用
- php随机函数
- 信号的概念
- Android远程获取图片并本地缓存
- js中数组(Array)重排序方法深析
- linux学习笔记十:rpm常用命令
- 多线程下载文件
- 网卡的组成和工作原理--MAC PHY
- Freeswitch on centos编译安装指南
- 辨异 —— Python 的深拷贝与浅拷贝
- 强化System.Convert.ChangeType, 使其能够转换枚举ENUM和可空类型Nullable
- 函数书写的规则
- cpu——oprofile使用札记
- myeclipse 快捷键
- 如何快速下载xcode等官方app
- 转 python range 用法
- init可执行程序的结构都有哪些