隐藏或删除uiLabels以提高性能 [英] hide or remove uiLabels for performance

查看:89
本文介绍了隐藏或删除uiLabels以提高性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在长滚动视图上有200多个uiLabels,我需要提高滚动性能.当标签不可见时,隐藏和取消隐藏标签,或者释放它们并重新创建它们,是否更好? 我已经在标签上贴上标签,目前正在使用这些标签来隐藏/取消隐藏:

I have 200+ uiLabels on a long scrollview, I need to improve scrolling performance. Is it better to hide and unhide labels, or release them and recreate them, when they are out of view? I have put tags on them, I am currently using those to hide / unhide with:

for (int i=0; i<42; i++) {
        [theScroller viewWithTag:i].hidden = NO;
    }

反之亦然,由滚动contentOffset.y值触发.

and visa versa, triggered by scroll contentOffset.y values..

我的uiLabels集合在一个plist中,因此它也易于发布和重建吗?

I have my uiLabels collection in a plist so its also easy to release and rebuild them?

感谢您的帮助.

推荐答案

@Mark是,最好将标签放开,就像它们不在视线范围内,不使用一样,这样可以改善性能并帮助您您进行内存管理.

@Mark yes it would be better to release the labels,as if they are out of view,not in use,so they will improve the performance and also help you for memory management.

这篇关于隐藏或删除uiLabels以提高性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆