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

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

问题描述

我正在从 MySQL 将数据加载到一个数组中,并且我想将它们填充到 UITableCiew 中.如何向 UITableView 添加多个列(在我的情况下为 4)?

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?

推荐答案

UICollectionViewiOS 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 非常相似.

I am currently using AQGridView so surely i recommend that as it is the least buggy and its functions are very similar to 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天全站免登陆