UITableView的横向使用
UITableView只支持竖向显示,要实现横向的显示,需要设置tableView 和cell 的transform属性为CGAffineTransformMakeRotate(-M_PI/2)
// 42.5是TableView的高度,320是UITableView的宽度
_tabTableView = [[UITableView alloc] initWithFrame:CGRectMake(, 66, 42.5, )];
_tabTableView.dataSource = self;
_tabTableView.delegate = self;
_tabTableView.showsVerticalScrollIndicator = NO;
_tabTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
// 设置TableView显示的位置
_tabTableView.center = CGPointMake(320 / , 66);
_tabTableView.transform = CGAffineTransformMakeRotation(-M_PI_2);
[self.view addSubview:_tabTableView];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
TabTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"tab"];
if (cell == nil) {
cell = [[TabTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"tab"];
}
[cell setTitle:_tabArrays[indexPath.row]];
//这里也要设置一下
cell.transform = CGAffineTransformMakeRotation(M_PI_2);
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return ;//设置横向cell的高度
}

UITableView的横向使用的更多相关文章
- UITableView 的横向滑动实现
UITableView 的横向滑动实现 概述 为了实现横向滑动的控件,可以继承类 UIScrollView 或类 UIView 自定义可以横向滑动的控件,这里通过 UITableView 的旋转,实现 ...
- iOS有关横向TableView的东西
之前看到Apple store里面有横向的tableview,当然也有可能是collectionview啦. 尤其是项目中只有一条那么需要横向滑动的东西,就没有必要使用庞大的collectionvie ...
- iOS各种开源类库
KissXml——xml解析库 相关教程:http://www.iteye.com/topic/625849 http://sencho.blog.163.com/blog/static/830562 ...
- iOS开源 框架
UI界面类项目: Panoramagl ——720全景展示 Panorama viewer library foriPhone, iPad and iPod touch MBProgressHUD — ...
- iOS开源项目大全
UI界面类项目: Panoramagl —— 720全景展示 Panorama viewer library for iPhone, iPad and iPod touch MBProgressHUD ...
- 多个UITableView横向切换的简单实现(有点类似网易新闻)
实现多列表切换,位置监控,置顶等功能. 方法一: 创建一个TableView,在切换的时候请求各类目需要的数据,然后刷新列表,通过动画模拟出滑动效果. #import <UIKit/UIKit. ...
- ios知识点总结——UITableView的展开与收缩及横向Table
UITableVIew是iOS开发中使用最为广泛的一种控件,对于UITableView的基本用法本文不做探讨,本文主要是针对UITableView的展开与收缩进行阐述,在文章的后面也会探讨一下横向ta ...
- iOS使用XZMRefresh实现UITableView或UICollectionView横向刷新
https://blog.csdn.net/u013285730/article/details/50615551?utm_source=blogxgwz6 XZMRefresh The easies ...
- UITableView横向滚动
UITableView 设置 CGRect tableViewRect = CGRectMake(0.0, 0.0, 50.0, 320.0); self.tableView = [[UITableV ...
随机推荐
- VMware 密匙
11.0版本 1F04Z-6D111-7Z029-AV0Q4-3AEH8 亲测可用
- [bzoj4361] isn [树状数组+dp+容斥原理]
题面 传送门 思路 首先,本题目的核心元素是非降子序列,而显然这个题目中的子序列只和序列的长度.位置,以及互相之间的包含关系,这些东西相关 所以我们可以依据这些先"猜"(实际上是估 ...
- HDU 4910 HDOJ Problem about GCD BestCoder #3 第四题
首先 m = 1 时 ans = 0对于 m > 1 的 情况 由于 1 到 m-1 中所有和m互质的数字,在 对m的乘法取模 运算上形成了群 ai = ( 1<=a<m & ...
- 《c程序设计语言》读书笔记-3.6-数字转字符串最小宽度限制
#include <io.h> #include <stdio.h> #include <string.h> #include <stdlib.h> # ...
- hdu 4388 Stone Game II sg函数 博弈
Stone Game II comes. It needs two players to play this game. There are some piles of stones on the d ...
- HDU1710---树(知前序遍历与中序遍历 求后序遍历)
知前序遍历与中序遍历 求后序遍历 #include<iostream> #include<cstring> #include<queue> #include< ...
- display:inline、block、inline-block的区别 摘】
display:block就是将元素显示为块级元素. block元素的特点是: 总是在新行上开始: 高度,行高以及顶和底边距都可控制: 宽度缺省是它的容器的100%,除非设定一个宽度 <div& ...
- VS2013 Sqlite3 操作指令
extern "C"{ #include "sqlite3.h" }; #pragma comment(lib,"sqlite.lib") ...
- 一篇不错的v4l2入门文档【转】
转自:http://blog.chinaunix.net/uid-26851094-id-3270803.html 原帖地址: http://www.isongzi.com/2009/02/23/v4 ...
- 安卓SDK安装时出现的小问题
在SDK Manager启动安装后出现网页不能访问的错误 错误日志如下 Fetching URL: https://dl-ssl.google.com/android/repository/repos ...