問題描述
我是 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.tableFooterView
以編程方式在 UITableViewController
的 viewDidLoad
方法中添加頁腳.但是我在 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 添加頁腳的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!