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

  • 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. 可以用的远程maven地址

    <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...

  2. angular 兼容ie7 bootstrap2兼容ie6

    http://stackoverflow.com/questions/12709745/angular-routing-not-working-in-ie7/12891208#12891208

  3. [转]MySQL中int(11)最大长度是多少?

    原文地址:https://blog.csdn.net/allenjay11/article/details/76549503 今天在添加数据的时候,发现当数据类型为 int(11) 时,我当时让用户添 ...

  4. Where-To-Put-The-Auto-Layout-Code(AutoLayout代码应该放在哪里?)

    Where-To-Put-The-Auto-Layout-Codehtml, body {overflow-x: initial !important;}html { font-size: 14px; ...

  5. html标签之img

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. Linux:ssh端口转发详解

    ssh是个多用途的工具,不仅可以远程登录,还可以搭建socks代理.进行内网穿透,这是利用它的端口转发功能来实现的. 所谓ssh端口转发,就是在ssh连接的基础上,指定 ssh client 或 ss ...

  7. Sencha Touch 2.3 自定义主题皮肤,颜色

    写博客园越来越懒了,只写重点部分,不明白的可以Q我. 1.当你通过Cmd生成项目之后,App\resources\sass就是我们的样式源文件 2.想自定义自己的样式分为两种方式 扩展:这个是基于st ...

  8. 安卓程序代写 网上程序代写[原]自定义View

    一. 自定义View介绍 自定义View时, 继承View基类, 并实现其中的一些方法. (1) ~ (2) 方法与构造相关 (3) ~ (5) 方法与组件大小位置相关 (6) ~ (9) 方法与触摸 ...

  9. ThinkPHP使用memcache缓存服务器

    (1)Thinkphp的默认缓存方式是以File方式,在/Runtime/Temp 下生成了好多缓存文件. 服务器装了memcached后想给更改成memecache方式 在Conf/config.p ...

  10. Mac和Linux下pip更换源

    cd ~mkdir .pip vim .pip/pip.conf 在pip.conf中写入 [global]timeout = 6000index-url = https://pypi.tuna.ts ...