必威体育Betway必威体育官网
当前位置:首页 > IT技术

强制UIView刷新

时间:2019-07-04 14:42:20来源:IT技术作者:seo实验室小编阅读:62次「手机版」
 

bbboo

官方文档:

- (void)setNeedsdisplay

Marks the receiver’s entire bounds rectangle as needing to be redrawn.

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.

需要注意:

1、异步,该更新间隙让你去废弃无效的视图(all invalidated views are updated)。

2、CAEAGLLayer 无效,这里要注意GLKView。

3、UIView的内容或者外观发生改变建议调用

4、调用后已存在的内容回根据 contentMode 属性自适应

5、不要重画没有改变的内容

相关阅读

Vue.js应用回退或刷新界面时提示用户保存修改

 在实际应用中,运营人员在编辑数据时不希望因不小心点击了浏览器的回退或刷新按钮导致花费了很长时间编辑的数据丢失。可以采用以

location reload页面实现跳转和刷新

  1 history.go(0)2 location.reload()3 location=location4 location.assign(location)5 document.execCommand('Refresh')6

js刷新当前页面的5种方式

1。 reload reload 方法,该方法强迫浏览器刷新当前页面。 语法:location.reload([bForceGet])    参数: bForceGet, 可选参数, 默

windows下host文件修改与刷新

1、window环境: hosts文件位置:C:\windows\system32\drivers\etc 刷新方式: ctrl+r,输入CMD,回车 在命令行执行:ipconfig /flushdn

js刷新页面location.reload()用法

              js刷新页面location.reload()用法 转载:https://blog.csdn.net/sinat_17775997/article/details/80263724

分享到:

栏目导航

推荐阅读

热门阅读