QuartzCore shadow - lag UITableView?

时光总嘲笑我的痴心妄想 提交于 2019-12-08 12:15:46

问题


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.

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!


回答1:


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.



来源:https://stackoverflow.com/questions/8282898/quartzcore-shadow-lag-uitableview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!