项目进入收尾阶段,我主要负责一些小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
}