博客> UIVIew API
UIVIew API
2017-06-24 16:12 评论:0 阅读:181 vipsamuel
swift init

- setNeedsDisplay()

DeClaration:

You can use this method or the setNeedsDisplayInRect: to notify the system that your view's need to be redraw._(你使用这个方法通知系统,你的view's需要重新绘制)This method makes a note of the request and returns immediately.(这个方法创建一个请求标记并立即返回)The view is not actually redrawn until the next drawing cycle(这个view事实上不是重绘工具到下一个周期),at which point all invalidated views are updated(在这个点上所有无效视图被更新)._

note

If your view is backed by a CAEAGLLayer object,this method has no effect(如果你的视图依赖CAEAGLLayer对象(这个方法不受影响).It is intended for use only with views that use native drawing technologied 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 redraw(如果你简单的改变view的几何,view通常不会改变).Instead,its existing content is adjusted based on the value in the view's contentMode property(相反,在这个View的contentMode property属性里其存在的内容的value上调整基础)..Redisplaying the existing content improves performance by avoiding the need to redraw content that has not changed(重新显示已存在的内容提供了性能避免需要绘制的内容并没有改变).

收藏
1
sina weixin mail 回到顶部