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的横向使用的更多相关文章

  1. UITableView 的横向滑动实现

    UITableView 的横向滑动实现 概述 为了实现横向滑动的控件,可以继承类 UIScrollView 或类 UIView 自定义可以横向滑动的控件,这里通过 UITableView 的旋转,实现 ...

  2. iOS有关横向TableView的东西

    之前看到Apple store里面有横向的tableview,当然也有可能是collectionview啦. 尤其是项目中只有一条那么需要横向滑动的东西,就没有必要使用庞大的collectionvie ...

  3. iOS各种开源类库

    KissXml——xml解析库 相关教程:http://www.iteye.com/topic/625849 http://sencho.blog.163.com/blog/static/830562 ...

  4. iOS开源 框架

    UI界面类项目: Panoramagl ——720全景展示 Panorama viewer library foriPhone, iPad and iPod touch MBProgressHUD — ...

  5. iOS开源项目大全

    UI界面类项目: Panoramagl —— 720全景展示 Panorama viewer library for iPhone, iPad and iPod touch MBProgressHUD ...

  6. 多个UITableView横向切换的简单实现(有点类似网易新闻)

    实现多列表切换,位置监控,置顶等功能. 方法一: 创建一个TableView,在切换的时候请求各类目需要的数据,然后刷新列表,通过动画模拟出滑动效果. #import <UIKit/UIKit. ...

  7. ios知识点总结——UITableView的展开与收缩及横向Table

    UITableVIew是iOS开发中使用最为广泛的一种控件,对于UITableView的基本用法本文不做探讨,本文主要是针对UITableView的展开与收缩进行阐述,在文章的后面也会探讨一下横向ta ...

  8. iOS使用XZMRefresh实现UITableView或UICollectionView横向刷新

    https://blog.csdn.net/u013285730/article/details/50615551?utm_source=blogxgwz6 XZMRefresh The easies ...

  9. UITableView横向滚动

    UITableView 设置 CGRect tableViewRect = CGRectMake(0.0, 0.0, 50.0, 320.0); self.tableView = [[UITableV ...

随机推荐

  1. (原、整)Unreal源码 CoreUbject- Uobject

    (原.整) Unreal源码 CoreUbject- Uobject 类别                    [随笔分类]Unreal源码搬山 @author:白袍小道 随缘那啥 这里还是属于UE ...

  2. 【志银】NYOJ《题目524》A-B Problem

    题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=860 My思路: 先用两个字符串储存这两个实数,然后再用另外两个字符串储存去掉符号和前后多 ...

  3. Ubuntu下禁用笔记本自带键盘

    想要禁用笔记本自带键盘(Ubuntu)只要2条命令. 1. 打开终端,输入: xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ...

  4. .net网站数据抓取

    最新项目需要抓取人民币汇率中间价的数据,所以就写了个简单的爬虫抓取数据.抓取的网站为:http://www.safe.gov.cn/wps/portal/sy/tjsj_hlzjj_inquire # ...

  5. VS2017 + EF + MySQL 我使用过程中遇到的坑

    原文:VS2017 + EF + MySQL 我使用过程中遇到的坑 写在前面: 第一次使用MySQL连接VS的时候本着最新版的应该就是最好的,在MySQL官网下载了最新版的MySQL没有并且安装完成之 ...

  6. Ajax---概念介绍

    Ajax不是某种编程语言,是一种在无需重新加载整个网页的情况下能够更新部分网页的技术. 运用HTML和CSS来实现页面,表达信息: 运用XMLHttpRequest和Web服务器进行数据的异步交换: ...

  7. Codeforces 938.B Run For Your Prize

    B. Run For Your Prize time limit per test 1 second memory limit per test 256 megabytes input standar ...

  8. centos 7 服务器网卡做bond

    前期环境准备 [root@ /root] alibaba cloud#cat /etc/redhat-releaseCentOS Linux release 7.4.1708 (Core)[root@ ...

  9. spring boot 2.0之后默认的连接池 HIkariCP介绍

    HIkariCP链接池比之传统的Tomcat JDBC datasource .c3p0 datasource 等传统链接池优势太大,在获取链接释放链接,执行效率上面高出很多,这个产品的口号是“快速. ...

  10. JAVA下几个问题

    一.Server MyEclipse Tomcat v8.5 was unable to start within 45 seconds. If the server requires more ti ...