UIView addsubview after orientation change: Tell view to resize

后端 未结 4 2172
别那么骄傲
别那么骄傲 2021-01-05 09:08

I have a UIView as a XIB in Portrait mode.

This view is added programmatically to the viewcontroller like this:

NSArray *nibObjects = [[NSBundle main         


        
4条回答
  •  感动是毒
    2021-01-05 10:07

    See this related question:

    When do autoresizing masks take effect in iOS?

    So after loading your new view from the nib, and adding as a subview to self.view, try calling setNeedsLayout.

提交回复
热议问题