We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Thanks for creating a really nice library, but I'm a little confused right now. Constraints not working after using FlexLayout for subviews
class CellsViewController: UIViewController {
override func viewDidLoad() { super.viewDidLoad() view.flex.define { flex in flex.addItem(infoView).height(60).marginTop(64) } } override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() view.flex.layout() } lazy var infoView: AnimationView = { let value = AnimationView(frame: .zero) return value }()
}
class AnimationView: UIView { override init(frame: CGRect) { super.init(frame: frame) backgroundColor = .green flex.paddingHorizontal(12) .alignItems(.center) .direction(.row) .define { flex in flex.addItem(doubleTitileView) } } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } lazy var doubleTitileView: DoubleTitleView = { let value = DoubleTitleView(frame: .zero) return value }() override func layoutSubviews() { super.layoutSubviews() self.layout() } func layout(){ self.flex.layout() } }
class DoubleTitleView: UIView { override init(frame: CGRect) { super.init(frame: frame) initInterface() }
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } func initInterface() { self.flex.direction(.column) .justifyContent(.center) .define { flex in flex.addItem(titleLabel) flex.addItem(subLabel) } } override func layoutSubviews() { super.layoutSubviews() self.flex.layout() } lazy var titleLabel: UILabel = { let value = UILabel() value.font = UIFont.systemFont(ofSize: 16) value.text = "textOne" return value }() lazy var subLabel: UILabel = { let value = UILabel() value.font = UIFont.systemFont(ofSize: 14) value.text = "textOneTwo" return value }() }
The padding and alignItems doesn`t work
The text was updated successfully, but these errors were encountered:
remove the subview 's layoutsubviews() method. I don't know why
Sorry, something went wrong.
No branches or pull requests
Thanks for creating a really nice library, but I'm a little confused right now. Constraints not working after using FlexLayout for subviews
class CellsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.flex.define { flex in
flex.addItem(infoView).height(60).marginTop(64)
}
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
view.flex.layout()
}
lazy var infoView: AnimationView = {
let value = AnimationView(frame: .zero)
return value
}()
}
class AnimationView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .green
flex.paddingHorizontal(12)
.alignItems(.center)
.direction(.row)
.define { flex in
flex.addItem(doubleTitileView)
}
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
lazy var doubleTitileView: DoubleTitleView = {
let value = DoubleTitleView(frame: .zero)
return value
}()
override func layoutSubviews() {
super.layoutSubviews()
self.layout()
}
func layout(){
self.flex.layout()
}
}
class DoubleTitleView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
initInterface()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func initInterface() {
self.flex.direction(.column)
.justifyContent(.center)
.define { flex in
flex.addItem(titleLabel)
flex.addItem(subLabel)
}
}
override func layoutSubviews() {
super.layoutSubviews()
self.flex.layout()
}
lazy var titleLabel: UILabel = {
let value = UILabel()
value.font = UIFont.systemFont(ofSize: 16)
value.text = "textOne"
return value
}()
lazy var subLabel: UILabel = {
let value = UILabel()
value.font = UIFont.systemFont(ofSize: 14)
value.text = "textOneTwo"
return value
}()
}
The padding and alignItems doesn`t work
The text was updated successfully, but these errors were encountered: