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. 孤荷凌寒自学python第二十九天python的datetime.time模块

     孤荷凌寒自学python第二十九天python的datetime.time模块 (完整学习过程屏幕记录视频地址在文末,手写笔记在文末) datetime.time模块是专门用来表示纯时间部分的类. ...

  2. 1155 Heap Paths (30 分)(堆+dfs遍历)

    比较简单的一题 遍历左右的时候注意一下 #include<bits/stdc++.h> using namespace std; ; ]; ; vector<int>t; ve ...

  3. 一个画ROC曲线的封装包

    Draw_ROC_Curves This is a python file which is used for drawing ROC curves -f : assign file name -t ...

  4. shell之一些测试脚本

    比较文件有无修改,通过修改时间判别 # !/bin/bash dir=$ for file in `ls $dir` do if [ -d $dir/$file ] then echo $file i ...

  5. Java 实现二叉树的构建以及3种遍历方法

    转载自http://ocaicai.iteye.com/blog/1047397 大二下学期学习数据结构的时候用C介绍过二叉树,但是当时热衷于java就没有怎么鸟二叉树,但是对二叉树的构建及遍历一直耿 ...

  6. 软工实践Alpha冲刺(7/10)

    队名:起床一起肝活队 组长博客:博客链接 作业博客:班级博客本次作业的链接 组员情况 组员1(队长):白晨曦 过去两天完成了哪些任务 描述: 已经解决登录注册等基本功能的界面. 完成非功能的主界面制作 ...

  7. HDU 3549 基础网络流EK算法 Flow Problem

    欢迎参加——BestCoder周年纪念赛(高质量题目+多重奖励) Flow Problem Time Limit: 5000/5000 MS (Java/Others)    Memory Limit ...

  8. [poj] 3907 Build Your Home || 求多边形面积

    原题 多组数据,到0为止. 每次给出按顺序的n个点(可能逆时针,可能顺时针),求多边形面积(保留整数) 多边形面积为依次每条边(向量)叉积/2的和 \(S=\sum _{i=1}^{n-1}p[i]* ...

  9. BZOJ2756 [SCOI2012]奇怪的游戏 【网络流 + 二分】

    题目 Blinker最近喜欢上一个奇怪的游戏. 这个游戏在一个 N*M 的棋盘上玩,每个格子有一个数.每次 Blinker 会选择两个相邻 的格子,并使这两个数都加上 1. 现在 Blinker 想知 ...

  10. Ubuntu14连接MySql报错“can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock'”

    起因:我在Ubuntu14 64位系统中安装mysql后,后来通过mysql -u用户名 -p密码 的命令连接 Mysql数据库时,报错"can't connect to local mys ...