消除模态视图时清除 UIView / UIScrollView 内容
我目前有一个显示在模态视图中的 UIView / UIScrollView 。它基本上是一个详细视图,当用户单击链接时提供页面视图。当视图被关闭然后再次打开时(当用户单击另一个按钮时),先前加载的内容仍然可见,并且新内容加载在最后一个内容的“顶部”。这是有道理的,因为 UIView / UIScrollView 的实例会持续存在,并且仅在需要内存时才被释放。
但是,我想在模式视图关闭时完全清除 UIView / UIScrollView ,以便 1)清除内容并 2)释放内存。
I currently have a UIView / UIScrollView that is displayed within a modal view. It is basically a detail view that provides a view of a page when the user clicks a link. When the view is dismissed and then brought up again (when the user clicks another button), the previously-loaded content is still visible and the new content loads "on top" of the last content. This makes sense because the instance of the UIView / UIScrollView persists and is only released when the memory is needed.
However, I would like to completely clear the UIView / UIScrollView when the modal view is dismissed so that 1) content is cleared and 2) memory is freed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
rightDetailedView = [[UIScrollView alloc] init];
rightDetailedView.backgroundColor = [UIColor 白色颜色];
每次调用此方法时,上面的代码都会初始化视图,据我所知,当我们重新创建视图时,背景将是透明的,因此我们需要添加带有whiteColr或某种颜色的backgroundColor。
谢谢,
克里斯:)
rightDetailedView = [[UIScrollView alloc] init];
rightDetailedView.backgroundColor = [UIColor whiteColor];
The above code initializes the view every time this method is called and to my knowledge when we are recreating a view the background will be transparent so we need to add backgroundColor with whiteColr or some color.
Thanks,
Kris :)