UITableView横向滚动
2014-08-20 10:39
225 查看
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;
}
相关文章推荐
- [IOS]UITableView横向滚动
- UITableView横向滚动
- UITableView 横向滚动(一)
- UITableView横向滚动
- UITableView 横向滚动(一)
- UITableView横向滚动
- Android TextView文字横向自动滚动(跑马灯)
- uitableview滚动到最后一行
- ios知识点总结——UITableView的展开与收缩及横向Table
- 如何让 UITableView 的 headerView跟随 cell一起滚动
- adnroid textview设置文字横向自动滚动(跑马灯效果)
- 使 UITableViewStylePlain Style 的TableView header 不浮动,像Group Style 那样固定,跟随Tableview 滚动,而不会停在顶端。
- NSTimer在UITableView滚动时暂停工作
- iOS开发之让UITableView滚动控制并返回到最顶端
- IOS中UITableView滚动到指定位置
- 横向分页滚动的UICollectionView,cell左右排版
- iOS - Swift UICollectionView横向分页滚动,cell左右排版
- iOS 利用UICollectionView横向滚动、余弦函数曲线特性实现居中放大的卡片浏览工具 XLCardSwitch
- IOS UItableView 滚动到底 触发事件
- 横向滚动和竖直滚动结合,scrollview嵌套多个HorizontalScrollView