Adding up the percentages for stacks.
This commit is contained in:
parent
0d6322b693
commit
21fc9c1802
@ -37,16 +37,14 @@ import Foundation
|
|||||||
contentView.addSubview(stack)
|
contentView.addSubview(stack)
|
||||||
containerHelper.constrainView(stack)
|
containerHelper.constrainView(stack)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
// MARK: - Molecule
|
// MARK: - Molecule
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
|
|
||||||
override open func reset() {
|
override open func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
stack.reset()
|
stack.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||||
super.setWithModel(model, delegateObject, additionalData)
|
super.setWithModel(model, delegateObject, additionalData)
|
||||||
guard let model = model as? ListRightVariablePaymentsModel else { return}
|
guard let model = model as? ListRightVariablePaymentsModel else { return}
|
||||||
@ -54,9 +52,9 @@ import Foundation
|
|||||||
rightImage.setWithModel(model.image, delegateObject, additionalData)
|
rightImage.setWithModel(model.image, delegateObject, additionalData)
|
||||||
|
|
||||||
// Create a stack model to use for the internal stack and set the alignment of label and image
|
// Create a stack model to use for the internal stack and set the alignment of label and image
|
||||||
let leftLabel = StackItemModel()
|
let leftLabel = StackItemModel(percent: 70)
|
||||||
leftLabel.horizontalAlignment = .leading
|
leftLabel.horizontalAlignment = .leading
|
||||||
let rightImage = StackItemModel()
|
let rightImage = StackItemModel(percent: 30)
|
||||||
rightImage.horizontalAlignment = .trailing
|
rightImage.horizontalAlignment = .trailing
|
||||||
let stackModel = StackModel(molecules: [leftLabel,rightImage])
|
let stackModel = StackModel(molecules: [leftLabel,rightImage])
|
||||||
stackModel.axis = .horizontal
|
stackModel.axis = .horizontal
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user