文档描述不够详细,有人测试结果如下:

  • init does not cause layoutSubviews to be called (duh)
  • addSubview causes layoutSubviews to be called on the view being added, the view it’s being added to (target view), and all the subviews of the target
  • view setFrame intelligently calls layoutSubviews on the view having its frame set only if the size parameter of the frame is different
  • scrolling a UIScrollView causes layoutSubviews to be called on the scrollView, and its superview
  • rotating a device only calls layoutSubview on the parent view (the responding viewControllers primary view)
  • Resizing a view will call layoutSubviews on its superview

什么时候layoutSubview会被调用的更多相关文章

  1. ios中layoutsubview何时被调用

    layoutsubview和viewDidlayoutsubview(控制器)被调用的集中情况 一:当view的frame或bounds发生改变 1:直接改view的frame或bounds 会调用v ...

  2. ios layoutsubView 何时被调用

    -layoutSubviews方法:这个方法,在UIView中默认没有做任何事情,需要子类进行重写.UIView是一个纯净的视图,里面没有任何子控件,所以不会做什么事情.一般系统自带控件中有子控件的都 ...

  3. iOS 使用UIView的一种有效方法

    在一个典型的MVC结构 中,Model部分负责保存目标数据,View部分主要负责实现数据的界面以及将数据显示出来,二者在Controller的操作下协同工作.在iOS应用中,View的实现主要由UIV ...

  4. OpenGL ES 响应屏幕旋转 iOS

    iOS下使用OpenGL 如果使用GLKit View 那么不用担心屏幕旋转的问题,说明如下: If you change the size, scale factor, or drawable pr ...

  5. OpenGL ES: iOS 自定义 UIView 响应屏幕旋转

    iOS下使用OpenGL 如果使用GLKit View 那么不用担心屏幕旋转的问题,说明如下: If you change the size, scale factor, or drawable pr ...

  6. 黑马毕向东Java基础知识总结

    Java基础知识总结(超级经典) 转自:百度文库 黑马毕向东JAVA基础总结笔记    侵删! 写代码: 1,明确需求.我要做什么? 2,分析思路.我要怎么做?1,2,3. 3,确定步骤.每一个思路部 ...

  7. 《果壳中的C# C# 5.0 权威指南》 - 学习笔记

    <果壳中的C# C# 5.0 权威指南> ========== ========== ==========[作者] (美) Joseph Albahari (美) Ben Albahari ...

  8. 重新调用 layoutSubview

    重新调用 layoutSubview

  9. 20180329-layoutSubviews的调用机制

    如果你想强制更新布局,不要直接调用此方法,你可以调用setNeedsLayout方法,如果你想立即显示你的views,你需要调用layoutIfNeed方法 layoutSubviews作用: lay ...

随机推荐

  1. jsp传给java属性,java生成json串,方便以后取出来

    前台代码 $.ajax({ url : '<%=basePath%>userorderother/canUpdateCust.do', type : 'POST', data: {'kdc ...

  2. MySQL日志——二进制日志

    Mac怎么这么坑呢,搞了2小时了.唉 先来一个简单的,挖好坑,明天解决. 终端进入mysql: mysql> set global general_log=on; 然后进行数据库的任意操作: 查 ...

  3. Postgresql分表与优化

    --1.创建主表 CREATE TABLE tbl_partition ( date_key date, hour_key smallint, client_key integer, item_key ...

  4. Adroid我还是个菜鸟——导入jar包

    AndroidStudio怎样导入jar包 原文地址:http://jingyan.baidu.com/article/e6c8503c7190b7e54f1a1893.html AndroidStu ...

  5. sublime 之 vitage/emmet

    ctrl+shift+p 打开Package Controlctrl+shift+t 恢复已关闭标签ctrl+/ 代码注释/取消注释 --------------------------------- ...

  6. ecshop常用的一些变量

    <!-- {if $smarty.session.user_rank gt 1}-->gt大于 lt小于1:ecshop模板中调用session的值 {$smarty.session.us ...

  7. Qt判断操作系统代码

    Qt4的时候是如下宏定义.Qt5,有所不同.   #include <QtGlobal> ... #ifdef Q_OS_MAC // mac #endif #ifdef Q_OS_LIN ...

  8. export Jar from eclipse (总结)

    sourceforge 的源码网址 :https://sourceforge.net/projects/fjep/files/fatjar/ <span style="margin:0 ...

  9. SAP 金税接口代码 供参考

    程序可以通过抓取 客户 开票信息等 下载文本 导出 需要事先创建好几个structure zc0000sdt0016, zc0000sdt0017 REPORT zc0000sdr0016 NO ST ...

  10. 【转】【Centos】安装 lnmpa 集成开发环境

    解压完毕之后执行 ./install.sh lnmpa 系统需求: CentOS/RHEL/Fedora/Debian/Ubuntu/Raspbian Linux系统 需要3GB以上硬盘剩余空间 12 ...