updated constraints
This commit is contained in:
parent
dd49c43946
commit
709277362f
@ -92,12 +92,12 @@ open class BulletList: Container {
|
|||||||
// Adds the molecules and sets the json.
|
// Adds the molecules and sets the json.
|
||||||
for (index, map) in list.enumerated() {
|
for (index, map) in list.enumerated() {
|
||||||
if let item = items?[index] {
|
if let item = items?[index] {
|
||||||
item.leftText = bulletChar
|
item.leftText = bulletChar ?? String(index+1)
|
||||||
item.setWithJSON(map, delegateObject: delegateObject, additionalData: nil)
|
item.setWithJSON(map, delegateObject: delegateObject, additionalData: nil)
|
||||||
addView(item, lastItem: index == list.count - 1)
|
addView(item, lastItem: index == list.count - 1)
|
||||||
} else {
|
} else {
|
||||||
let leftLabel = LeftLabelRightMoleculeContainer()
|
let leftLabel = LeftLabelRightMoleculeContainer()
|
||||||
leftLabel.leftText = bulletChar
|
leftLabel.leftText = bulletChar ?? String(index+1)
|
||||||
leftLabel.setWithJSON(map, delegateObject: delegateObject, additionalData: additionalData)
|
leftLabel.setWithJSON(map, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
addView(leftLabel, lastItem: index == list.count - 1)
|
addView(leftLabel, lastItem: index == list.count - 1)
|
||||||
}
|
}
|
||||||
@ -214,9 +214,16 @@ class LeftLabelRightMoleculeContainer: View {
|
|||||||
addSubview(rightContainer)
|
addSubview(rightContainer)
|
||||||
addSubview(leftContainer)
|
addSubview(leftContainer)
|
||||||
leftContainer.addSubview(label)
|
leftContainer.addSubview(label)
|
||||||
//NSLayoutConstraint.constraintPinSubview(toSuperview: label)
|
|
||||||
NSLayoutConstraint.constraintPinSubview(label, pinTop: true, pinBottom: false, pinLeft: true, pinRight: false)
|
NSLayoutConstraint.constraintPinSubview(label, pinTop: true, pinBottom: false, pinLeft: true, pinRight: false)
|
||||||
leftContainer.leftAnchor.constraint(greaterThanOrEqualTo: label.rightAnchor).isActive = true
|
label.rightAnchor.constraint(greaterThanOrEqualTo: leftContainer.leftAnchor).isActive = true
|
||||||
|
let labelRightAnchor = label.rightAnchor.constraint(equalTo: leftContainer.leftAnchor)
|
||||||
|
labelRightAnchor.priority = UILayoutPriority(rawValue: 200)
|
||||||
|
labelRightAnchor.isActive = true
|
||||||
|
leftContainer.bottomAnchor.constraint(greaterThanOrEqualTo: label.bottomAnchor).isActive = true
|
||||||
|
let labelBotAnchor = leftContainer.bottomAnchor.constraint(equalTo: label.bottomAnchor)
|
||||||
|
labelBotAnchor.priority = UILayoutPriority(rawValue: 200)
|
||||||
|
labelBotAnchor.isActive = true
|
||||||
|
|
||||||
NSLayoutConstraint.constraintPinSubview(leftContainer, pinTop: true, pinBottom: false, pinLeft: true, pinRight: false)
|
NSLayoutConstraint.constraintPinSubview(leftContainer, pinTop: true, pinBottom: false, pinLeft: true, pinRight: false)
|
||||||
bottomAnchor.constraint(greaterThanOrEqualTo: leftContainer.bottomAnchor).isActive = true
|
bottomAnchor.constraint(greaterThanOrEqualTo: leftContainer.bottomAnchor).isActive = true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user