Commit b9da09fa authored by David黄金龙's avatar David黄金龙

布局

parent ac1c1b0e
......@@ -58,8 +58,22 @@ class YHWholeScreenTipsView: UIView {
}()
lazy var fakeLine : UIView = {
let view : UIView = UIView()
view.backgroundColor = .clear
return view
}()
private var curType : YHWholeScreenTipsViewType = .unKnow
init(type: YHWholeScreenTipsViewType, targetView : UIView) {
super.init(frame: UIScreen.main.bounds)
curType = type
contentLable.text = getTitleBy(type: type)
self.createUI(targetView : targetView)
}
......@@ -133,15 +147,39 @@ class YHWholeScreenTipsView: UIView {
left = left - offset - 16
}
whiteContentView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(left)
make.top.equalToSuperview().offset(top)
make.width.equalTo(214)
}
contentLable.snp.makeConstraints { make in
make.top.left.equalTo(12)
make.right.bottom.equalTo(-12)
if curType == .renewTimeTips {
//目标控件的上方
let otherTop = rrrrr.origin.y - 5
addSubview(fakeLine)
fakeLine.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(1)
make.top.equalToSuperview().offset(otherTop)
}
whiteContentView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(left)
make.bottom.equalTo(fakeLine.snp.top)
make.width.equalTo(214)
}
contentLable.snp.makeConstraints { make in
make.top.left.equalTo(12)
make.right.bottom.equalTo(-12)
}
} else {
//目标控件的下方
whiteContentView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(left)
make.top.equalToSuperview().offset(top)
make.width.equalTo(214)
}
contentLable.snp.makeConstraints { make in
make.top.left.equalTo(12)
make.right.bottom.equalTo(-12)
}
}
}
}
......
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