문제

What is the real difference between UIView methods setNeedsLayout and setNeedsDisplay?

As usual documentation is foggy about this.

도움이 되었습니까?

해결책

Actually the documentation is pretty clear about this:

  • setNeedsLayout will layout subviews

    Call this method on your application’s main thread when you want to adjust the layout of a view’s subviews.

  • setNeedsDisplay will call for a redraw of your view (drawRect:, etc).

    You can use this method or the setNeedsDisplayInRect: to notify the system that your view’s contents need to be redrawn.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top