开发者

Does setNeedsDisplay have immediate effect or it is merely queued for later?

开发者 https://www.devze.com 2023-03-30 16:31 出处:网络
Does anybody here know whether setNeedsDisplay results in an immediate drawRect call and immediate updatin开发者_运维知识库g of the screen?

Does anybody here know whether setNeedsDisplay results in an immediate drawRect call and immediate updatin开发者_运维知识库g of the screen? Or is it merely a queued request? Thanks.


The view is not actually redrawn until the next drawing cycle. This simply notifies the system that the view should be redrawn.

See UIView Class Reference

You can apparently accomplish this by setting the content mode to UIViewContentModeRedraw. I haven't done this personally, but the code should be something along the lines of

UIView *redrawView = [[UIView alloc] initWithFrame:frame];
...
redrawView.contentMode = UIViewContentModeRedraw;

See View and Window Modes: Content Modes

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号