UIView的setNeedsDisplay方法
2013-08-06 23:28
239 查看
setNeedsDisplay
Marks the receiver’s entire bounds rectangle as needing to be redrawn.
让接收者的整个边界矩形在需要时被重画。
- (void)setNeedsDisplay
Discussion
You can use this method or the setNeedsDisplayInRect: to notify the system that your view’s contents need to be redrawn. This method makes a note of the request and returns immediately. The view is not actually redrawn
until the next drawing cycle, at which point all invalidated views are updated.
Note: If your view is backed by a
CAEAGLLayer object, this method has no effect. It is intended for use only with views that use native drawing technologies (such as UIKit and Core Graphics) to render their content.
You should use this method to request that a view be redrawn only when the content or appearance of the view change. If you simply change the geometry of the view, the view is typically not redrawn. Instead, its existing content is adjusted based
on the value in the view’s contentMode property. Redisplaying the existing content improves performance by avoiding the need to redraw content that has not changed.
Availability
Available in iOS 2.0 and later.
See Also
– drawRect:
– setNeedsDisplayInRect:
@property contentMode
Related Sample Code
avTouch
CoreTextPageViewer
PocketCoreImage
SpeakHere
TableViewSuite
Declared In
UIView.h
Marks the receiver’s entire bounds rectangle as needing to be redrawn.
让接收者的整个边界矩形在需要时被重画。
- (void)setNeedsDisplay
Discussion
You can use this method or the setNeedsDisplayInRect: to notify the system that your view’s contents need to be redrawn. This method makes a note of the request and returns immediately. The view is not actually redrawn
until the next drawing cycle, at which point all invalidated views are updated.
Note: If your view is backed by a
CAEAGLLayer object, this method has no effect. It is intended for use only with views that use native drawing technologies (such as UIKit and Core Graphics) to render their content.
You should use this method to request that a view be redrawn only when the content or appearance of the view change. If you simply change the geometry of the view, the view is typically not redrawn. Instead, its existing content is adjusted based
on the value in the view’s contentMode property. Redisplaying the existing content improves performance by avoiding the need to redraw content that has not changed.
Availability
Available in iOS 2.0 and later.
See Also
– drawRect:
– setNeedsDisplayInRect:
@property contentMode
Related Sample Code
avTouch
CoreTextPageViewer
PocketCoreImage
SpeakHere
TableViewSuite
Declared In
UIView.h
相关文章推荐
- iOS学习之——UIView的setNeedsDisplay和setNeedsLayout方法
- UIView常用方法之setNeedsDisplay和setNeedsLayout
- UIView的setNeedsDisplay和setNeedsLayout方法区别
- UIView常用方法之setNeedsDisplay和setNeedsLayout
- UIView常用的一些方法setNeedsDisplay和setNeedsLayout
- UIView常用的一些方法之setNeedsDisplay和setNeedsLayout
- UIView的setNeedsDisplay和setNeedsLayout方法
- 关于setNeedsDisplay、setNeedsLayout方法,UIView的layoutSubviews和drawRect方法何时调用
- UIView的setNeedsDisplay和setNeedsLayout方法
- UIView的setNeedsDisplay和setNeedsLayout方法
- UIView的setNeedsDisplay和setNeedsLayout方法
- UIView的setNeedsDisplay和setNeedsLayout方法
- UIView的drawRect: 和 - (void)setNeedsDisplay 的一些理解
- UIView的setNeedsDisplay和setNeedsLayout区别
- UIView的setNeedsLayout, layoutIfNeeded 和 layoutSubviews 方法之间的关系解释
- UIView的setNeedsLayout, layoutIfNeeded 和 layoutSubviews 方法之间的关系解释
- UIView的setNeedsLayout, layoutIfNeeded 和 layoutSubviews 方法之间的关系解释
- UIview需要知道的一些事情:setNeedsDisplay、setNeedsLayout
- [转]谈谈UIView的几个layout方法-layoutSubviews、layoutIfNeeded、setNeedsLayout.
- UIView的setNeedsLayout, layoutIfNeeded 和 layoutSubviews 方法之间的关系解释