gpt4 book ai didi

ios - setNeedsLayout 和 setNeedsDisplay

转载 作者:IT王子 更新时间:2023-10-29 07:33:45 25 4
gpt4 key购买 nike

UIView 方法 setNeedsLayoutsetNeedsDisplay 之间的真正区别是什么?

像往常一样,文档对此模糊不清。

最佳答案

实际上文档对此很清楚:

  • setNeedsLayout将布局 subview

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

  • setNeedsDisplay将要求重绘您的 View (drawRect: 等)。

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

关于ios - setNeedsLayout 和 setNeedsDisplay,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14506968/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com