I'm relatively new to iOS swift, but is there a difference between doing this
class MyCustomHeaderSection: UITableViewHeaderFooterView
{
...
}
myTableView.register(MyCustomHeaderSection.self, forHeaderFooterViewReuseIdentifier: "section_header")
And the following approach
class MyCustomHeaderSection: UITableViewCell
{
...
}
myTableView.register(MyCustomHeaderSection.self, forCellReuseIdentifier: "section_header")
UI 方面没有区别,两者都可以作为页眉/页脚使用,但MyCustomHeaderSection: UITableViewHeaderFooterView
真正用于页眉/页脚,而class MyCustomHeaderSection: UITableViewCell
用于表的实际内容单元格
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.