Commit ee34ac7d by Daniel Dahan

development: added automatic removal of subviews when reloading button containers

parent 2904209e
......@@ -324,6 +324,10 @@ public class BasicCardView : MaterialCardView, Comparable {
buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false
buttonsContainer!.backgroundColor = MaterialTheme.clear.color
addSubview(buttonsContainer!)
} else {
for v in buttonsContainer!.subviews {
v.removeFromSuperview()
}
}
reloadView()
}
......
......@@ -453,6 +453,10 @@ public class ImageCardView : MaterialCardView, Comparable {
buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false
buttonsContainer!.backgroundColor = MaterialTheme.clear.color
addSubview(buttonsContainer!)
} else {
for v in buttonsContainer!.subviews {
v.removeFromSuperview()
}
}
reloadView()
}
......
......@@ -86,6 +86,10 @@ public class NavigationBarView: UIView {
leftButtonsContainer!.translatesAutoresizingMaskIntoConstraints = false
leftButtonsContainer!.backgroundColor = MaterialTheme.clear.color
addSubview(leftButtonsContainer!)
} else {
for v in leftButtonsContainer!.subviews {
v.removeFromSuperview()
}
}
reloadView()
}
......@@ -109,6 +113,10 @@ public class NavigationBarView: UIView {
rightButtonsContainer!.translatesAutoresizingMaskIntoConstraints = false
rightButtonsContainer!.backgroundColor = MaterialTheme.clear.color
addSubview(rightButtonsContainer!)
} else {
for v in rightButtonsContainer!.subviews {
v.removeFromSuperview()
}
}
reloadView()
}
......
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