How to make automatic viewing of UIView in full screen when switching orientation

Do I need to write code so that UIView fills the window area when switching orientation? Is there a simple setup?

+4
source share
1 answer

If the view initially takes up the entire screen and the application is set to autorotate, all you have to do is set the autoresist mask in the view to change the width and height:

view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 

Edit: see my comment below how to do this in IB

+7
source

Source: https://habr.com/ru/post/1341872/


All Articles