constraint change
This commit is contained in:
parent
d44a193ff0
commit
d9b23e4a58
@ -42,7 +42,6 @@ open class OrderTracker: View {
|
||||
guard let stepModels = stepModels else { return }
|
||||
|
||||
var anchor = topAnchor
|
||||
var previousStep: Step?
|
||||
|
||||
for stepModel in stepModels {
|
||||
|
||||
@ -56,11 +55,10 @@ open class OrderTracker: View {
|
||||
step.topAnchor.constraint(equalTo: anchor).isActive = true
|
||||
|
||||
anchor = step.bottomAnchor
|
||||
previousStep = step
|
||||
}
|
||||
|
||||
bottomAnchor.constraint(equalTo: anchor).isActive = true
|
||||
previousStep?.imageBottomConstraint?.constant = 0
|
||||
(subviews.last as? Step)?.heightConstraint?.isActive = false
|
||||
}
|
||||
|
||||
func resetSteps() {
|
||||
|
||||
@ -23,7 +23,7 @@ open class Step: View {
|
||||
// MARK: - Constraints
|
||||
//--------------------------------------------------
|
||||
|
||||
public var imageBottomConstraint: NSLayoutConstraint?
|
||||
public var heightConstraint: NSLayoutConstraint?
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Computed Properties
|
||||
@ -71,9 +71,9 @@ open class Step: View {
|
||||
bodyBottomConstraint.priority = .defaultHigh
|
||||
bodyBottomConstraint.isActive = true
|
||||
|
||||
let heightConstraint = heightAnchor.constraint(equalToConstant: 58)
|
||||
heightConstraint.priority = .defaultLow
|
||||
heightConstraint.isActive = true
|
||||
heightConstraint = heightAnchor.constraint(equalToConstant: 58)
|
||||
heightConstraint?.priority = .defaultLow
|
||||
heightConstraint?.isActive = true
|
||||
}
|
||||
|
||||
public override func reset() {
|
||||
@ -83,7 +83,7 @@ open class Step: View {
|
||||
bodyTop.reset()
|
||||
bodyBottom.reset()
|
||||
stateImage.reset()
|
||||
imageBottomConstraint?.constant = Padding.Ten
|
||||
heightConstraint?.isActive = true
|
||||
}
|
||||
|
||||
//------------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user