So this is the weirdest thing I came across ever.
I add a simple UIView
on top of an UIView
on an UIViewController
. I change the size to 200 x 200 and then I want to change the UIView
's size by placing this line of code inside the viewDidLoad
method:
self.gameBackgroundView.frame.size.height = 10
which seems perfectly normal in Swift. Though, nothing happens. I can change the color, corner radius etc...
EDIT:
I have also deleted all constraints from that view and it still does not work.
Ok, So I found a solution here on stack ..
Change frame programmatically with auto layout
The correct answer, that works is, that:
Thank you all!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With