停靠模式
2016-02-19 09:28
218 查看
停靠模式
当父视图改变时 子视图跟着改变
在xib中修改autosizing
手写代码:
@property(nonatomic) UIViewAutoresizing autoresizingMask; // simple resize. default is UIViewAutoresizingNone
设置UIView的这个属性 枚举 6个值
xib的布局适配
通过设置停靠模式 来等比例拉伸等
横竖屏是依赖设置停靠模式
@property(nonatomic) UIViewAutoresizing autoresizingMask; // simple resize. default is UIViewAutoresizingNone
_playView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
当父视图改变时 子视图跟着改变
在xib中修改autosizing
手写代码:
@property(nonatomic) UIViewAutoresizing autoresizingMask; // simple resize. default is UIViewAutoresizingNone
设置UIView的这个属性 枚举 6个值
xib的布局适配
通过设置停靠模式 来等比例拉伸等
横竖屏是依赖设置停靠模式
@property(nonatomic) UIViewAutoresizing autoresizingMask; // simple resize. default is UIViewAutoresizingNone
_playView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
相关文章推荐