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:

  1. i need create iboutlet of heightconstraint
  2. change value of constraint accordingly

thank all!


Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -