When is layoutSubviews called?

后端 未结 9 1748
忘掉有多难
忘掉有多难 2020-11-22 14:58

I have a custom view that\'s not getting layoutSubview messages during animation.

I have a view that fills the screen. It has a custom subview at the bo

9条回答
  •  醉梦人生
    2020-11-22 15:18

    https://developer.apple.com/library/prerelease/tvos/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingViews/CreatingViews.html#//apple_ref/doc/uid/TP40009503-CH5-SW1

    Layout changes can occur whenever any of the following events happens in a view:

    a. The size of a view’s bounds rectangle changes.
    b. An interface orientation change occurs, which usually triggers a change in the root view’s bounds rectangle.
    c. The set of Core Animation sublayers associated with the view’s layer changes and requires layout.
    d. Your application forces layout to occur by calling the setNeedsLayout or layoutIfNeeded method of a view.
    e. Your application forces layout by calling the setNeedsLayout method of the view’s underlying layer object.

提交回复
热议问题