如何在 Storyboard 中为 UITableView 添加页脚 [英] How to add a footer to a UITableView in Storyboard

查看:24
本文介绍了如何在 Storyboard 中为 UITableView 添加页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 iOS 开发还很陌生.

I'm fairly new to iOS development.

我想在 UITableViewController 的表格视图中添加一个页脚.我已经在 Storyboard 中以图形方式制作了我想用作页脚的视图,但是我不知道如何将它作为页脚连接到我的表视图.

I want to add a footer to the table view in a UITableViewController. I've made the view I want to use as the footer graphically in Storyboard, however I can't work out how to hook it up as the footer to my table view.

我可以通过分配 self.tableView.tableFooterViewUITableViewControllerviewDidLoad 方法中以编程方式添加页脚.但是我已经在 Storyboard 中创建了我的页脚视图,将它作为页脚添加到我的表格视图中的最佳实践是什么?

I can add a footer programmatically in UITableViewController's viewDidLoad method by assigning self.tableView.tableFooterView. But I've created my footer view in Storyboard, what is the best practice way of adding it as the footer to my table view?

推荐答案

您只需将一个视图拖到 tableView 的底部区域即可.您将在层次结构中看到它将是 tableview 的子视图.然后就可以将标签、按钮等子视图拖到那里,调整高度等

You can just drag a view to the bottom area of the tableView. You'll see in the hierarchy that it will be a subview of the tableview. You can then drag subviews such as labels and buttons there, adjust the height, etc.

这篇关于如何在 Storyboard 中为 UITableView 添加页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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