add additional field example in the footer of addition cell

This commit is contained in:
Bob Sun 2017-02-21 01:06:03 +08:00
parent e40cadaec1
commit 2829e9145d
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
2 changed files with 9 additions and 4 deletions

View file

@ -21,6 +21,7 @@ class PasswordEditorTableViewController: UITableViewController {
[Dictionary<PasswordEditorCellKey, Any>]
]()
var sectionHeaderTitles = [String]()
var sectionFooterTitles = [String]()
override func viewDidLoad() {
super.viewDidLoad()
@ -33,6 +34,8 @@ class PasswordEditorTableViewController: UITableViewController {
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 48
tableView.allowsSelection = false
self.tableView.sectionFooterHeight = UITableViewAutomaticDimension;
self.tableView.estimatedSectionFooterHeight = 0;
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
@ -56,10 +59,6 @@ class PasswordEditorTableViewController: UITableViewController {
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 44
}
override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0.1
}
override func numberOfSections(in tableView: UITableView) -> Int {
return tableData.count
@ -72,6 +71,10 @@ class PasswordEditorTableViewController: UITableViewController {
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return sectionHeaderTitles[section]
}
override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
return sectionFooterTitles[section]
}
}