tags:

views:

37

answers:

0

I have a UIScrollView with subview with shadow enabled as follows:

UIView *contentView = ...;
contentView.layer.shadowOffset = ...;
contentView.layer.shadowRadius = ...;

I noticed that scrolling performance degrades (scrolling becomes really choppy) if I increase the size of the subview or add many small subviews with shadow enabled. So, there seems to be (inverse) correlation between shaded area size and performance. What is the cause of this?

As a side, I resolved the performance issue by capturing the shadow in UIImage and adding it as a subview underneath respective view. However, I am interested to learn about the root cause of the performance degradation in the first place.