ios - Why can't I change the view's frame size in Swift? -
so weirdest thing came across ever.
i add simple uiview on top of uiview on uiviewcontroller. change size 200 x 200 , want change uiview's size placing line of code inside viewdidload method:
self.gamebackgroundview.frame.size.height = 10 which seems normal in swift. though, nothing happens. can change color, corner radius etc...
edit:
i have deleted constraints view , still not work.
ok, found solution here on stack ..
change frame programmatically auto layout
the correct answer, works is, that:
- i need create iboutlet of heightconstraint
- change value of constraint accordingly
thank all!
Comments
Post a Comment