jsdw_ios/QuickLocation/Section/Home/SearchLocation/SearchLocationHeaderView.swift

54 lines
1.5 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// SearchLocationHeaderView.swift
// QuickLocation
//
import UIKit
/// hero +
final class SearchLocationHeaderView: UIView {
let headlineLab = UILabel()
let subheadLab = UILabel()
let heroImageView = UIImageView()
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
private func setupUI() {
addSubview(heroImageView)
addSubview(headlineLab)
addSubview(subheadLab)
heroImageView.backgroundColor = .clear
heroImageView.contentMode = .scaleAspectFit
heroImageView.image = UIImage(named: "SearchLocation/header_bg")
heroImageView.layoutChain
.top()
.centerX()
.width(288)
.height(190)
headlineLab.text = "实时查看TA的位置"
headlineLab.font = FontManager.boboBold(30)
headlineLab.textColor = UIColor(hexStr: "#293445")
headlineLab.textAlignment = .center
headlineLab.layoutChain
.topToBottomOfView(heroImageView, offset: 67)
.centerX()
subheadLab.text = "为你安心守护出行安全"
subheadLab.font = .systemFont(ofSize: 18, weight: .bold)
subheadLab.textColor = UIColor(hexStr: "#293445")
subheadLab.textAlignment = .center
subheadLab.layoutChain
.topToBottomOfView(headlineLab, offset: 20)
.centerX()
.bottom()
}
}