Commit 50de3b7c authored by Maurice Kraus's avatar Maurice Kraus
Browse files

fix(akamuuikit): this tries to resolve the animation layout issue

parent 52335730
......@@ -11,26 +11,35 @@ import UIKit
public class VsHeaderView: UIView {
public var playerInfos: (PlayerInfo, PlayerInfo)
public var title: String
private var needsSetup = true
public init(title: String, playerInfos: (PlayerInfo, PlayerInfo)) {
self.title = title
self.playerInfos = playerInfos
super.init(frame: .zero)
setupUI()
}
public required init?(coder: NSCoder) {
title = ""
playerInfos = (PlayerInfo(name: "", image: UIImage()), PlayerInfo(name: "", image: UIImage()))
super.init(coder: coder)
setupUI()
}
override public init(frame: CGRect) {
title = ""
playerInfos = (PlayerInfo(name: "", image: UIImage()), PlayerInfo(name: "", image: UIImage()))
super.init(frame: frame)
setupUI()
}
public override func layoutSubviews() {
super.layoutSubviews()
if avatarsView.frame.height > 0 {
// avatarsView.alpha = 1
}
if needsSetup {
needsSetup = false
setupUI()
}
}
private func setupUI() {
......@@ -38,6 +47,7 @@ public class VsHeaderView: UIView {
spacer.snp.makeConstraints { make in
make.height.equalTo(40)
}
avatarsView.alpha = 0
let headerStackView = UIBackgroundStackView(arrangedSubviews: [spacer, titleLabel, avatarsView], backgroundColor: Colors.akamuBlue)
headerStackView.axis = .vertical
headerStackView.spacing = 40
......
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