当前位置: 首页 > news >正文

关于网页制作的网站优化大师手机版下载安装app

关于网页制作的网站,优化大师手机版下载安装app,微信小程序是什么框架,南通经济开发区城乡建设局网站UITableView自定义TableHeader和TableFooter 我猜你希望的效果是这样的 我猜你希望的效果是这样的 自定义页眉视图 让我们创建一个文件名 UITableViewHeaderFooterView 的 CustomerHeaderView 子类。 现在让我们创建视图的 Xib 文件并将其命名为 CustomHeaderView。 更改高度标…

UITableView自定义TableHeader和TableFooter

    • 我猜你希望的效果是这样的

我猜你希望的效果是这样的

在这里插入图片描述

自定义页眉视图
让我们创建一个文件名 UITableViewHeaderFooterView 的 CustomerHeaderView 子类。
在这里插入图片描述
现在让我们创建视图的 Xib 文件并将其命名为 CustomHeaderView。

在这里插入图片描述

更改高度标题视图在创建的 XIB 文件中选择视图。在属性检查器中选择大小并将其大小设置为自由度

在这里插入图片描述

自定义页脚视图 让我们创建一个文件名 UITableViewHeaderFooterView 的客户页脚视图
子类并重复上述步骤。

在主类文件中,寄存器头视图和页脚视图在视图中的表视图DidLoad

class ViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
tableView.delegate = self
tableView.dataSource = self
tableView.register(UINib(nibName: "CustomHeaderView", bundle: nil), forHeaderFooterViewReuseIdentifier: "CustomHeaderView")
tableView.register(UINib(nibName: "CustomFooterView", bundle: nil), forHeaderFooterViewReuseIdentifier: "CustomFooterView")}
}
 func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {let indentifier = "CustomHeaderView"let cell = tableView.dequeueReusableHeaderFooterView(withIdentifier: indentifier)if section == 0 {cell?.contentView.backgroundColor = .cyan}if section == 1 {cell?.contentView.backgroundColor = .red}return cell}func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {let indentifier = "CustomHeaderView"let cell = tableView.dequeueReusableHeaderFooterView(withIdentifier: indentifier)cell?.contentView.backgroundColor = UIColor.tableSectionColor()return cell}func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {return 100}func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {return 50 }
http://www.dinnco.com/news/81689.html

相关文章:

  • 专题网站建设解决方案客服外包
  • 微网站地图定位html网页制作动态效果
  • 做搜狗pc网站全国疫情最新名单
  • wordpress改url不能访问北京seo网站管理
  • 网站对联广告代码百度一下你就知道原版
  • 网站建设如何测试今天最火的新闻头条
  • ip查询网站备案查询系统学生个人网页制作代码
  • 备案 网站下线推广之家官网
  • 给个做的网站吗杭州百度推广代理商
  • 如何做自己的影视网站广州代运营公司有哪些
  • 网站建设与维护属于什么岗位广告公司推广
  • 昆山做企业网站咸宁网站seo
  • 外贸网站用什么字体seo的特点是什么
  • 如何做高网站的浏览量接广告推广的平台
  • 罗田住房和城乡建设局网站公众号排名优化
  • 做外汇网站代理武汉seo服务外包
  • 做个卖车票的网站怎么做网络推广和运营的区别
  • 服装网站公司网站关键词搜索工具
  • 比较好的源码网站东莞seo管理
  • 建设独立网站需要什么时候电脑系统优化软件
  • 烟台海阳市专业做网站2022最近比较火的营销事件
  • tomcat做网站并发产品软文代写
  • 有没有做公章的网站电子商务专业就业方向
  • 网站上的3d怎么做的seo薪酬如何
  • 做网站推广需要做什么北京全网营销推广公司
  • 兰州网站做的好点的公司常见的网络营销工具
  • 做个公司网站一般多少钱seo扣费系统
  • 建设网站开通网线多少钱竞价排名广告
  • 南京直销网站开发百度电话客服24小时
  • 烟台智能建站模板天津网站建设公司