pageViewController.view.frame = topView.bounds
pageViewController.view.autoresizingMask = [.FlexibleWidth,.FlexibleHeight]
这是个固定搭配,实现目的是,设置子视图的frame和父视图的bounds相等,自动布局的时候,让子视图和父视图同步放大或缩小
本文介绍了一种在Swift UI中实现自动布局的方法:通过设置pageViewController.view的frame等于topView.bounds,并配置autoresizingMask属性为.FlexibleWidth和.FlexibleHeight,使子视图能够随父视图变化而自适应调整大小。
pageViewController.view.frame = topView.bounds
pageViewController.view.autoresizingMask = [.FlexibleWidth,.FlexibleHeight]
这是个固定搭配,实现目的是,设置子视图的frame和父视图的bounds相等,自动布局的时候,让子视图和父视图同步放大或缩小
1431

被折叠的 条评论
为什么被折叠?
