Commit 3f581fbd authored by David黄金龙's avatar David黄金龙

一处代码 完善

parent 9e95d2f7
...@@ -321,7 +321,6 @@ private extension YHBasicInfoFillView { ...@@ -321,7 +321,6 @@ private extension YHBasicInfoFillView {
tmpHoldView.dataModel = subModel.subset tmpHoldView.dataModel = subModel.subset
tmpHoldView.callBackBlock = { tag in tmpHoldView.callBackBlock = { tag in
self.model?.info = tag self.model?.info = tag
// self.layoutForYES()
} }
mutilChoiceHoldView.addSubview(tmpHoldView) mutilChoiceHoldView.addSubview(tmpHoldView)
......
...@@ -29,23 +29,23 @@ class YHChoiceButtonHoldView: UIView { ...@@ -29,23 +29,23 @@ class YHChoiceButtonHoldView: UIView {
} }
private func updateView() { private func updateView() {
var x = 0 var x : CGFloat = 0
var y = 0 var y = 0
arrCheckBtns.removeAll() arrCheckBtns.removeAll()
for (index,item) in dataModel.enumerated() { for (index,item) in dataModel.enumerated() {
let string = item.subset_name.count > 0 ? item.subset_name : "--" let string = item.subset_name.isEmpty == false ? item.subset_name : "--"
let font = UIFont.PFSC_M(ofSize: 14)// 设置字体样式及大小 let font = UIFont.PFSC_M(ofSize: 14)// 设置字体样式及大小
let maxWidth = KScreenWidth - 28 * 2 // label最大宽度限制 let maxWidth : CGFloat = KScreenWidth - 28 * 2 // label最大宽度限制
let butGap : CGFloat = 25 let butGap : CGFloat = 25
var boundingBox = CGRect() var boundingBox = CGRect()
boundingBox = NSString(string: string).boundingRect(with: CGSize(width: maxWidth, height: .greatestFiniteMagnitude), options: [.usesLineFragmentOrigin], attributes: [.font : font], context: nil) boundingBox = NSString(string: string).boundingRect(with: CGSize(width: KScreenWidth, height: .greatestFiniteMagnitude), options: [.usesLineFragmentOrigin], attributes: [.font : font], context: nil)
let width = boundingBox.size.width let width = boundingBox.size.width
if CGFloat(x) + width + 18 + butGap > maxWidth { if CGFloat(x) + width + 18.0 + butGap > maxWidth {
x = 0 x = 0
y = y + 1 y = y + 1
} }
...@@ -91,7 +91,7 @@ class YHChoiceButtonHoldView: UIView { ...@@ -91,7 +91,7 @@ class YHChoiceButtonHoldView: UIView {
btn.isSelected = false btn.isSelected = false
} }
x = Int(CGFloat(x + Int(width)) + 18.0 + butGap) x = x + width + 18.0 + butGap
arrCheckBtns.append(btn) arrCheckBtns.append(btn)
} }
} }
......
...@@ -49,6 +49,12 @@ class YHOtherResidenceFillView: UIView { ...@@ -49,6 +49,12 @@ class YHOtherResidenceFillView: UIView {
guard let self = self else { return } guard let self = self else { return }
self.endView.updateKeyName(name: "结束时间", keyValue: "") self.endView.updateKeyName(name: "结束时间", keyValue: "")
self.dataModel?.end_time = text self.dataModel?.end_time = text
if flag {
self.dataModel?.end_time_checked = true
} else {
self.dataModel?.end_time_checked = false
}
self.layoutIfNeeded() self.layoutIfNeeded()
} }
endView.snp.makeConstraints { make in endView.snp.makeConstraints { make in
......
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