gpt4 book ai didi

apache-flex - validateProperties() 和 invalidateProperties() 之间的区别

转载 作者:行者123 更新时间:2023-12-02 07:45:43 25 4
gpt4 key购买 nike

谁能告诉我validateProperties()invalidateProperties() 有什么区别?

最佳答案

invalidateProperties :

Marks a component so that its commitProperties() method gets called during a later screen update.

Invalidation is a useful mechanism for eliminating duplicate work by delaying processing of changes to a component until a later screen update. For example, if you want to change the text color and size, it would be wasteful to update the color immediately after you change it and then update the size when it gets set. It is more efficient to change both properties and then render the text with its new size and color once.

Invalidation methods rarely get called. In general, setting a property on a component automatically calls the appropriate invalidation method.

validateProperties :

Used by layout logic to validate the properties of a component by calling the commitProperties() method. In general, subclassers should override the commitProperties() method and not this method.

本质上,validate 直接调用 commitProperties,而 invalidate 等待下一帧执行。始终使用无效。

关于apache-flex - validateProperties() 和 invalidateProperties() 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7185594/

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