UITableView横向滚动
2014-09-19 17:17
176 查看
1. UITableView 设置
CGRect tableViewRect = CGRectMake(0.0, 0.0, 50.0, 320.0);
self.tableView = [[UITableView alloc] initWithFrame:tableViewRect style:UITableViewStylePlain];
tableView.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height
/ 2);
tableView.delegate = self;
tableView.dataSource = self;
//tableview逆时针旋转90度。
tableView.transform = CGAffineTransformMakeRotation(-M_PI / 2);
// scrollbar 不显示
tableView.showsVerticalScrollIndicator = NO;
2. UITableViewCell 设置
- (UITableViewCell *)tableView :( UITableView *)aTableView cellForRowAtIndexPath :( NSIndexPath*)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"identifier"];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier@"identifier"]
autorelease];
// cell顺时针旋转90度
cell.contentView.transform = CGAffineTransformMakeRotation(M_PI / 2);
}
return cell;
}
CGRect tableViewRect = CGRectMake(0.0, 0.0, 50.0, 320.0);
self.tableView = [[UITableView alloc] initWithFrame:tableViewRect style:UITableViewStylePlain];
tableView.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height
/ 2);
tableView.delegate = self;
tableView.dataSource = self;
//tableview逆时针旋转90度。
tableView.transform = CGAffineTransformMakeRotation(-M_PI / 2);
// scrollbar 不显示
tableView.showsVerticalScrollIndicator = NO;
2. UITableViewCell 设置
- (UITableViewCell *)tableView :( UITableView *)aTableView cellForRowAtIndexPath :( NSIndexPath*)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"identifier"];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier@"identifier"]
autorelease];
// cell顺时针旋转90度
cell.contentView.transform = CGAffineTransformMakeRotation(M_PI / 2);
}
return cell;
}
相关文章推荐
- UITableView 横向滚动(一)
- UITableView横向滚动
- UITableView横向滚动
- UITableView 横向滚动(一)
- UITableView横向滚动
- [IOS]UITableView横向滚动
- iOS UITableView和UITableViewCell滚动和NSTimer计时
- TextView 实现横向滚动的方法
- UIScrollView ,UITableView 和 UICollectionView 如何滚动到顶部或底部
- 小程序scroll-view横向滚动
- UITableview 滚动到底部
- UITableView 滚动流程性优化
- Android:TextView文字横向自动滚动(跑马灯)
- iOS 如何让UITableView显示时自动滚动到底部(不闪动)
- iOS UITableView(十四) 设置TbleviewController的滚动范围
- 李洪强iOS开发之后使用XIB实现横向滚动的UIScrollView
- 关于uitableview禁用滚动后当点击一行后再去滑动时点击的那一行文字颜色变白的问题
- RecyclerView实现横向滚动
- Android TextView文字横向自动滚动(跑马灯)
- UITableView 滚动到指定行cell