具有多列的UITableView的多列标题 [英] Multi Column header for a UITableView with Multiple Columns

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

问题描述

我已经创建了一个带有多个列的UITableView来显示一个足球联赛表。现在我真正需要的是一个标题来标记每个列,这将理想地坐在表视图的顶部。

I have created a UITableView with multiple columns to display a Football League Table. Now what I really need is a header to label each column which will ideally sit at the top of the table view. How would I do this?

推荐答案

您可以创建一个自定义UIView,并将其设置为UITableView的第一个节头。返回它在你的UITableViewDelegate的tableView:viewForHeaderInSection:方法。您只需要设计它,使其与您的自定义单元格内的列一致。

You could create a custom UIView and set it as the first section header of your UITableView. Return it in your UITableViewDelegate's tableView:viewForHeaderInSection: method. You simply need to design it so that it aligns with the "columns" inside your custom cells.

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

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