Commit 4274e170 authored by David黄金龙's avatar David黄金龙

处理 活动行程详情的bug

parent bc021a41
......@@ -95,7 +95,7 @@ extension YHActivityTravelCell {
cancelButton.setTitleColor(UIColor.mainTextColor, for: .highlighted)
cancelButton.backgroundColor = .white
cancelButton.backgroundColor = .clear
cancelButton.layer.borderWidth = 1
cancelButton.layer.borderColor = UIColor.mainTextColor50.cgColor
......
......@@ -114,6 +114,59 @@ extension YHActivityTravelitemView {
timeLable.text = model.getDateString(format: "yyyy-MM-dd")
addressLable.text = model.place
navAddressLable.text = model.guidance
let hhhh = nameLabel.requiredHeight
timeStaticLable.snp.removeConstraints()
if hhhh > 72 {
timeStaticLable.snp.remakeConstraints { make in
make.left.equalTo(nameLabel.snp.left)
make.top.equalTo(nameLabel.snp.bottom).offset(24)
make.height.equalTo(20)
make.width.equalTo(28)
}
} else {
timeStaticLable.snp.remakeConstraints { make in
make.left.equalTo(nameLabel.snp.left)
make.top.equalTo(activityImgV.snp.bottom).offset(24)
make.height.equalTo(20)
make.width.equalTo(28)
}
}
timeLable.snp.remakeConstraints { make in
make.left.equalTo(timeStaticLable.snp.right).offset(16)
make.top.equalTo(timeStaticLable.snp.top)
make.right.equalToSuperview().offset(-20)
}
addressStaticLable.snp.remakeConstraints { make in
make.left.equalTo(timeStaticLable.snp.left)
make.top.equalTo(timeLable.snp.bottom).offset(13)
make.height.equalTo(timeStaticLable.snp.height)
make.width.equalTo(timeStaticLable.snp.width)
}
addressLable.snp.remakeConstraints { make in
make.left.equalTo(timeLable.snp.left)
make.top.equalTo(addressStaticLable.snp.top)
make.right.equalToSuperview().offset(-20)
}
navAddressLable.snp.remakeConstraints { make in
make.left.equalTo(addressLable.snp.left)
make.top.equalTo(addressLable.snp.bottom).offset(8)
make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview().offset(-20)
}
}
func setupUI() {
......
......@@ -50,4 +50,17 @@ extension UILabel {
label.sizeToFit()
return label.frame.width
}
var requiredHeight: CGFloat {
let label = UILabel(frame: CGRect(x: 0, y: 0, width: frame.width, height: CGFloat.greatestFiniteMagnitude))
label.numberOfLines = 0
label.lineBreakMode = NSLineBreakMode.byWordWrapping
label.font = font
label.text = text
label.attributedText = attributedText
label.sizeToFit()
return label.frame.height
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment