Setting the frame of an UIView does not work

前端 未结 4 1810
说谎
说谎 2020-12-28 16:16

I have a problem with the frame-property in iOS 7. I wanna resize some UIViews in the viewDidLoad-method of my UIViewController, but if I do it lik

4条回答
  •  无人及你
    2020-12-28 16:41

    Check to make sure that auto layout isn't activated in your storyboard file.

    To turn it off, look at the inspector in interface builder. Click the icon that looks like a page all the way on the left. In the section "Interface Builder Document" uncheck "Use Auto Layout."

    I find it's best to an entire view controller in IB with auto layout, or completely in code. Mixing the two can lead to weird behavior that is hard to debug.

提交回复
热议问题