乐驾项目博客-6

项目进入收尾阶段,我主要负责一些小bug的修改以及小功能的添加。

具体的话写了查询违章信息的功能,获取车辆logo图片,修改网络访问代码,核心内容如下:

    override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {

        let headerView = UIView(frame: CGRect(x: 0, y: 0, width: LJ.screenWidth, height: LJ.controlsHeight))

        headerView.backgroundColor = .clear

        

        let headerLabel = UILabel(frame: CGRect(x: 20, y: 0, width: LJ.screenWidth, height: LJ.controlsHeight))

        headerLabel.font = UIFont.systemFont(ofSize: 20, weight: UIFontWeightMedium)

        headerLabel.text = sectionTitle[section]

        headerView.addSubview(headerLabel)

        

        if section == 2 {

            changeCityButton = UIButton.init()

            changeCityButton.setTitleColor(UIColor(red: 66 / 255, green: 133 / 255, blue: 244 / 255, alpha: 1), for: .normal)

            changeCityButton.setTitle("济南", for: .normal)

            changeCityButton.addTarget(self, action: #selector(LifestyleViewController.chooseCityButtonTapped), for: .touchUpInside)

            headerView.addSubview(changeCityButton)

            changeCityButton.snp.makeConstraints {

                (make) in

                make.width.equalTo(40)

                make.height.equalTo(25)

                make.top.equalToSuperview().offset(10)

                make.right.equalToSuperview().offset(-15)

            }

        }

        

        return headerView

    }


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值