QuartzCore阴影-UITableView滞后吗? [英] QuartzCore shadow - lag UITableView?

查看:71
本文介绍了QuartzCore阴影-UITableView滞后吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UITableView(注意:UITableView在UIView中),我认为在其下面添加阴影会很好.我用QuartzCore添加了阴影,事实证明它非常好.但我也注意到,当我从详细视图"返回时,动画回到根部有点滞后.我听说QuartzCore和CoreAnimation会使应用程序变慢,或者在这种情况下,会增加延迟.

I have an UITableView (NOTE:The UITableView is in a UIView) and I thought it would be nice to have an shadow added below it. I add the shadow with QuartzCore and it turns out really nice. But I also notice that when I come back from a 'Detail View' the animation back to the root is a bit lag. I've heard that QuartzCore and CoreAnimation can make the app slower, or in this case, add lag.

首先,我对CoreAnimation使应用程序运行速度变慢吗?

First, am I right that CoreAnimation makes the app slower?

如果是这样,我该如何保持阴影,但要消除缓慢性和滞后性?

If so, how can I keep my shadow but remove the slowness and lag?

谢谢,我感谢所有的想法和答案!

Thanks and I appreciate all thoughts and answers!

推荐答案

尝试将另一个相同大小的视图放在表格视图后面,并让那个视图生成阴影.另外,如果提供显式的shadowPath,则层阴影的效率要高得多. 的有效方法是使用Core Graphics自己绘制阴影.

Try putting another view the same size behind the table view and have that view generate the shadow. Also, layer shadows are much more efficient if you supply an explicit shadowPath. The most efficient way is to draw the shadow yourself using Core Graphics.

这篇关于QuartzCore阴影-UITableView滞后吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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