When is layoutSubviews called?

后端 未结 9 1648
忘掉有多难
忘掉有多难 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:13

    have you looked at layoutIfNeeded?

    The documentation snippet is below. Does the animation work if you call this method explicitly during the animation?

    layoutIfNeeded Lays out the subviews if needed.

    - (void)layoutIfNeeded
    

    Discussion Use this method to force the layout of subviews before drawing.

    Availability Available in iPhone OS 2.0 and later.

提交回复
热议问题