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

金刚区 比例

parent 2464bb3a
...@@ -39,6 +39,8 @@ class YHHomeKingKongBlockItem: UIView { ...@@ -39,6 +39,8 @@ class YHHomeKingKongBlockItem: UIView {
updateUI() updateUI()
} }
} }
let radio : CGFloat = YHHomeKingKongBlockView.viewH / 71.0
} }
private extension YHHomeKingKongBlockItem { private extension YHHomeKingKongBlockItem {
...@@ -49,7 +51,7 @@ private extension YHHomeKingKongBlockItem { ...@@ -49,7 +51,7 @@ private extension YHHomeKingKongBlockItem {
iconV.snp.makeConstraints { make in iconV.snp.makeConstraints { make in
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.width.height.equalTo(31) make.width.height.equalTo(31)
make.top.equalTo(10) make.top.equalTo(10 * radio)
} }
addSubview(subtitleLable) addSubview(subtitleLable)
...@@ -58,7 +60,7 @@ private extension YHHomeKingKongBlockItem { ...@@ -58,7 +60,7 @@ private extension YHHomeKingKongBlockItem {
make.left.equalTo(4) make.left.equalTo(4)
make.right.equalTo(-4) make.right.equalTo(-4)
make.height.equalTo(17) make.height.equalTo(17)
make.bottom.equalTo(-8) make.bottom.equalTo(-8 * radio)
} }
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import UIKit import UIKit
class YHHomeKingKongBlockView: UIView { class YHHomeKingKongBlockView: UIView {
static let viewH : CGFloat = 71.0 static let viewH : CGFloat = (KScreenWidth - 20.0 * 2 - 17.0 * 3) / 4.0
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
initView() initView()
...@@ -29,7 +29,7 @@ class YHHomeKingKongBlockView: UIView { ...@@ -29,7 +29,7 @@ class YHHomeKingKongBlockView: UIView {
private extension YHHomeKingKongBlockView { private extension YHHomeKingKongBlockView {
func initView() { func initView() {
let itemGap : CGFloat = (KScreenWidth - 20.0 * 2 - YHHomeKingKongBlockView.viewH * 4.0) / 3.0 let itemGap : CGFloat = 17.0
var offsetX : CGFloat = 0 var offsetX : CGFloat = 0
for (index,item) in arrData.enumerated() { for (index,item) in arrData.enumerated() {
let view = YHHomeKingKongBlockItem() let view = YHHomeKingKongBlockItem()
......
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