tableView.tableHeaderView = myHeaderView let height = headerView.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize).height var frame = headerView.frame frame.size.height = height headerView.frame = frame
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
extension MyViewController: UITableViewDataSource {
// section数
func numberOfSections(in: UITableView) -> Int {
}
// row数
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
}
// 在section和row下,cell
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
}
}
tableView.estimatedRowHeight = 80 tableView.rowHeight = UITableViewAutomaticDimension
tv.estimatedSectionHeaderHeight = 20 tv.sectionHeaderHeight = UITableViewAutomaticDimension
tv.separatorStyle = .none
extension MyViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
}
}
extension TTEntranceExamReportViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
}
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: no)
// other code
}
if (IS_IPAD && [_tableView respondsToSelector:@selector(setCellLayoutMarginsFollowReadableWidth:)]) {
_tableView.cellLayoutMarginsFollowReadableWidth = NO;
}
if IS_IPAD, #available(iOS 9.0, *) {
tableView.cellLayoutMarginsFollowReadableWidth = false
}
cell.selectedBackgroundView = [[PureColorView alloc] initWithColor:[UIColor redColor]];
let tv = UITableView(frame: CGRect.zero, style: .grouped)
tv.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: 1, height: CGFloat.leastNormalMagnitude))
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
return self.tableView(tableView, heightForRowAt: indexPath)
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有