问题描述
我在滚动视图上放了一些图像视图。
当我拖动这个滚动视图时,我没有任何问题。
但是在我将阴影效果应用于这些图像视图后,拖动此滚动视图表现不佳。
我使用了shadowOpacity,shadowRadius和shadowOffset方法。
ex:
[[anImageView layer] shadowOpacity:1.0];
如果使用阴影效果会严重影响性能,我会直接绘制图像阴影。
如果有关于此问题的一些提示,请告诉我们。
我想在iOS上使用阴影效果以编程方式,因为我的绘图技巧最差。
感谢您的阅读。
参见(iOS 3.2+,但是shadowOffset / etc也是如此):
您可能还需要正确设置rasterizationScale。 / p>
I put some image views on scroll view.And when I drag this scroll view, I didn't have any problems.
But after I applied shadow effect to these image views, dragging this scroll view has bad performance.
I used shadowOpacity, shadowRadius and shadowOffset methods.
ex:
[ [ anImageView layer ] shadowOpacity: 1.0 ];
If using shadow effect causes bad performance seriously, I will draw shadow of the images directly.
If there are some tips about this issues, please let me know them.
I want to use shadow effect on iOS programically, because I have the worst drawing skill.
Thank you for your reading.
See CALayer.shouldRasterize (iOS 3.2+, but so is shadowOffset/etc):
You probably also want to set rasterizationScale appropriately.
这篇关于我在使用阴影效果方面表现不佳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!