美文网首页
layoutSubviews的触发时机

layoutSubviews的触发时机

作者: 闻道刘 | 来源:发表于2016-08-17 09:39 被阅读19次
    • init does not cause layoutSubviews to be called (duh)

    init方法不会触发

    • 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

    addSubview在目标视图被添加子视图的时候触发

    • view setFrame intelligently calls layoutSubviews on the view having its frame set only if the size parameter of the frame is different

    view的frame发生变化的时候触发

    • scrolling a UIScrollView causes layoutSubviews to be called on the scrollView, and its superview

    scrollview和它的父视图滚动的时候触发

    • rotating a device only calls layoutSubview on the parent view (the responding viewControllers primary view)

    转旋设备的时候,相应的视图控制器对应的主视图会触发

    • Resizing a view will call layoutSubviews on its superview

    改变视图大小的时候会在视图的父视图上触发

    stackoverflow链接

    相关文章

      网友评论

          本文标题:layoutSubviews的触发时机

          本文链接:https://www.haomeiwen.com/subject/aqrmsttx.html