Commit 4e6df320 authored by pete谢兆麟's avatar pete谢兆麟

按照图片比例调整头部试图

parent 6953a8a4
...@@ -15,7 +15,8 @@ class YHInvitationWithGiftsViewController: YHBaseViewController { ...@@ -15,7 +15,8 @@ class YHInvitationWithGiftsViewController: YHBaseViewController {
var viewModel: YHInvitationWithGiftsViewModel = YHInvitationWithGiftsViewModel() var viewModel: YHInvitationWithGiftsViewModel = YHInvitationWithGiftsViewModel()
lazy var headView : YHInvitationWithGiftsHeadView = { lazy var headView : YHInvitationWithGiftsHeadView = {
let headView = YHInvitationWithGiftsHeadView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 666)) let height = KScreenWidth/0.56
let headView = YHInvitationWithGiftsHeadView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: height))
return headView return headView
}() }()
......
...@@ -67,6 +67,7 @@ class YHInvitationWithGiftsHeadView: UIView { ...@@ -67,6 +67,7 @@ class YHInvitationWithGiftsHeadView: UIView {
func setUpView() { func setUpView() {
self.backgroundColor = UIColor(hex: 0xededed) self.backgroundColor = UIColor(hex: 0xededed)
let height = KScreenWidth / 0.735
centerImageView = { centerImageView = {
let view = UIImageView() let view = UIImageView()
view.image = UIImage(named: "invitation_with_gifts_head") view.image = UIImage(named: "invitation_with_gifts_head")
...@@ -75,9 +76,10 @@ class YHInvitationWithGiftsHeadView: UIView { ...@@ -75,9 +76,10 @@ class YHInvitationWithGiftsHeadView: UIView {
addSubview(centerImageView) addSubview(centerImageView)
centerImageView.snp.makeConstraints { make in centerImageView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview() make.left.right.top.equalToSuperview()
make.height.equalTo(510) make.height.equalTo(height)
} }
let bottomHeight = (KScreenWidth - 24) / 1.34
bottomImageView = { bottomImageView = {
let view = UIImageView() let view = UIImageView()
view.image = UIImage(named: "invitation_with_gifts_head_bottom") view.image = UIImage(named: "invitation_with_gifts_head_bottom")
...@@ -85,7 +87,7 @@ class YHInvitationWithGiftsHeadView: UIView { ...@@ -85,7 +87,7 @@ class YHInvitationWithGiftsHeadView: UIView {
}() }()
addSubview(bottomImageView) addSubview(bottomImageView)
bottomImageView.snp.makeConstraints { make in bottomImageView.snp.makeConstraints { make in
make.height.equalTo(262) make.height.equalTo(bottomHeight)
make.left.equalTo(12) make.left.equalTo(12)
make.right.equalTo(-12) make.right.equalTo(-12)
make.bottom.equalTo(-8) make.bottom.equalTo(-8)
...@@ -107,7 +109,7 @@ class YHInvitationWithGiftsHeadView: UIView { ...@@ -107,7 +109,7 @@ class YHInvitationWithGiftsHeadView: UIView {
make.height.equalTo(30) make.height.equalTo(30)
make.width.equalTo(209) make.width.equalTo(209)
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.top.equalTo(328) make.top.equalTo(0.87 * KScreenWidth)
} }
marqueeLabel = { marqueeLabel = {
......
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