如何绘制多列 UITableView? [英] How do I draw a multi-column UITableView?

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

问题描述

我想画一个像下图这样的多列UITableView,和普通的Custom Cell不同.

I want to draw a multi-column UITableView like the picture below, which is different than a common Custom Cell.

我该怎么做?

推荐答案

可以横向滚动吗?看起来不是这样.

Is it horizontally scrollable? It doesn't look so.

如果它只能垂直滚动,请使用常规 UITableView.对于每一行,您像往常一样使用 UITableViewCell.对于每一列,只需使用 UIButton 或您喜欢的任何小部件.在您的屏幕截图中,它看起来像列,但没有列的基本概念.

If it's only vertically scrollable, use a regular UITableView. For each row, you use a UITableViewCell as usual. For each column, just use a UIButton or any widget that you like. In your screenshot, it looks like columns but there is no underlying concept of columns.

您可以通过使用 Interface Builder 并加载自定义 nib 轻松创建自定义 UITableView 单元格.看看 http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7 下title "从 Nib 文件加载自定义表格视图单元格".

You can easily create custom UITableView cells by using Interface Builder and loading a custom nib. Look at http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7 under the title "Loading Custom Table-View Cells From Nib Files".

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

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