iOS学习之—— UIViewAutoresizing(自动布局)

UIViewAutoresizing是一个枚举类型,默认是UIViewAutoresizingNone,也就是不做任何处理。
UIViewAutoresizingNone不会随父视图的改变而改变
UIViewAutoresizingFlexibleLeftMargin自动调整view与父视图左边距,以保证右边距不变
UIViewAutoresizingFlexibleWidth自动调整view的宽度,保证左边距和右边距不变
UIViewAutoresizingFlexibleRightMargin自动调整view与父视图右边距,以保证左边距不变
UIViewAutoresizingFlexibleTopMargin自动调整view与父视图上边距,以保证下边距不变
UIViewAutoresizingFlexibleHeight自动调整view的高度,以保证上边距和下边距不变
UIViewAutoresizingFlexibleBottomMargin自动调整view与父视图的下边距,以保证上边距不变

[self.pageViewController.view setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];//自动调整view的宽度,保证上下左右边距不变

自动布局之autoresizingMask使用详解(Storyboard&Code):

http://www.cocoachina.com/ios/20141216/10652.html

你可能感兴趣的:(ios,自动布局)