使用自定义 UITableViewCell 与 UITableViewHeaderFooterView 之间有区别吗?
Is there a difference between using a custom UITableViewCell vs UITableViewHeaderFooterView?
我对 iOS swift 比较陌生,但是这样做有区别吗
class MyCustomHeaderSection: UITableViewHeaderFooterView
{
...
}
myTableView.register(MyCustomHeaderSection.self, forHeaderFooterViewReuseIdentifier: "section_header")
还有下面的做法
class MyCustomHeaderSection: UITableViewCell
{
...
}
myTableView.register(MyCustomHeaderSection.self, forCellReuseIdentifier: "section_header")
在 UI 方面没有区别,两者都将作为 header/footers 工作,但 MyCustomHeaderSection: UITableViewHeaderFooterView
确实意味着 headers/footers 而 class MyCustomHeaderSection: UITableViewCell
意味着对于 table
的实际内容单元格
我对 iOS swift 比较陌生,但是这样做有区别吗
class MyCustomHeaderSection: UITableViewHeaderFooterView
{
...
}
myTableView.register(MyCustomHeaderSection.self, forHeaderFooterViewReuseIdentifier: "section_header")
还有下面的做法
class MyCustomHeaderSection: UITableViewCell
{
...
}
myTableView.register(MyCustomHeaderSection.self, forCellReuseIdentifier: "section_header")
在 UI 方面没有区别,两者都将作为 header/footers 工作,但 MyCustomHeaderSection: UITableViewHeaderFooterView
确实意味着 headers/footers 而 class MyCustomHeaderSection: UITableViewCell
意味着对于 table