I read the documentation, but I just can’t figure out what exactly is needed in my simple case.
The element is constantly jumping. I need just that.
I would be grateful for articles and so on. For a deeper understanding of this
class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .white
let imageView = UIImageView()
view.addSubview(imageView)
self.view = view
}
}
2
Answers
You are looking for auto layout constraints.
E.g. add to your code:
You may want to set top, leading and trailing anchors, depending on the desired behavior.