layoutSubviews相关信息
来源:互联网 发布:滑轮组实验数据 编辑:程序博客网 时间:2024/06/03 20:53
关于这个方法的英文描述是:
Lays out subviews.
The default implementation of this method does nothing on iOS 5.1 and earlier. Otherwise, the default implementation uses any constraints you have set to determine the size and position of any subviews.
Subclasses can override this method as needed to perform more precise layout of their subviews. You should override this method only if the autoresizing and constraint-based behaviors of the subviews do not offer the behavior you want. You can use your implementation to set the frame rectangles of your subviews directly.
You should not call this method directly. If you want to force a layout update, call the setNeedsLayout method instead to do so prior to the next drawing update. If you want to update the layout of your views immediately, call the layoutIfNeeded method.
做一个简单介绍
布局subViews
在iOS5.1和之前的版本,默认执行这个方法是不做任何事的(do nothing)。如果你想让这个方法执行你所设定的布局约束条件,那么你就重写这个方法。那么这个方法在什么时候调用了?
以下几种方式:
- init初始化不会触发layoutSubviews
- addSubview会触发layoutSubviews
- 设置view的Frame会触发layoutSubviews,当然前提是frame的值设置前后发生了变化
- 滚动一个UIScrollView会触发layoutSubviews
- 旋转Screen会触发父UIView上的layoutSubviews事件
- 改变一个UIView大小的时候也会触发父UIView上的layoutSubviews事件
- layoutSubviews相关信息
- layoutSubviews相关总结
- 优秀工程师-layoutSubviews相关方法
- layoutSubviews
- layoutSubviews
- layoutSubviews
- layoutSubviews
- layoutSubviews
- layoutSubviews
- layoutSubViews
- layoutSubViews
- layoutSubviews
- layoutSubviews
- layoutSubviews
- layoutSubviews
- ios layoutSubviews 及 layout机制相关方法
- iOS学习笔记之layoutSubviews相关
- iOS layout的相关方法:layoutSubviews、layoutIfNeeded、setNeedsLayout
- 多线程编程之临界区的应用
- Android sdk更新,源码下载等
- window对象属性查询器
- Ecahrts 3.19 饼图 ajax+ashx+json
- Android ViewPager切换之PageTransformer接口中transformPage方法position参数使用详解
- layoutSubviews相关信息
- sed b
- 彻底理解ThreadLocal
- 应用服务器知识(4)--Tomcat是如何处理jsp和servlet请求
- java代码_批量导入_SpringMVC_JSON传值_Oracle数据库_id使用序列自增_示例
- 23种设计模式(2)-AbstractFactory 模式
- Genymotion虚拟机下载后windows下面的路径在哪儿?
- VR、AR、MR的区别
- 用C#一步步写串口通信