iOS中的UITableView多列 [英] Multiple columns to UITableView in iOS

查看:146
本文介绍了iOS中的UITableView多列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将数据加载到MySQL的数组中,我想在 UITableCiew 中填充它们。如何将多列(在我的情况下为4)添加到 UITableView

I am loading data into an array from MySQL, and I would like to populate them in UITableCiew. How can I add multiple columns (in my case 4) to UITableView?

我能够加载行数据,但我不明白如何将其分成列。是 UICollectionView 一个选项?如果是,我该怎么办呢?

I was able to load the row data but I do not understand how I can divide it up into columns. Is UICollectionView an option? If it is, how can I go about it?

推荐答案

UICollectionView 可以在 iOS 6.0及更高版本中使用,因此如果您想支持早期版本,则无法使用。
根据您的要求,您需要显示 GridView

UICollectionView is available in Available in iOS 6.0 and later and therefore cannot be used if you want to support earlier version. And as per your requirement you need to display a GridView

所以要支持早期版本并获得其他可以使用的酷炫功能这里的其他库是一些选项:

So to support earlier versions and get other cool features you can use other libraries here are some of the options:

1) KKGridView

2) UIGridView

3) AQGridView

4) NRGridView

5) MMGridView

6 ) WCGridView

我目前正在使用 AQGridView 所以我肯定推荐它,因为它是最少的马车,它的功能非常类似于的UITableView

此外,如果您尝试在没有 XIB 的情况下执行此操作,您将有点难以处理它,但您可以创建一个视图控制器与Xib文件一起创建您选择的接口。 这是关于如何以最佳方式完成工作的视频 Evadne Wu 。并且此处是示例项目

Also that If you are trying to do this without XIB it will be little bit difficult for you to handle it but you can create a view controller with Xib file to Create the interface of your choice. Here is the Video of how it can be done in the best possible way by Evadne Wu. And here is the Sample Project

这篇关于iOS中的UITableView多列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆