I Have bad performance on using shadow effect

后端 未结 4 1715
时光取名叫无心
时光取名叫无心 2021-02-08 12:33

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 th

4条回答
  •  逝去的感伤
    2021-02-08 13:08

    See CALayer.shouldRasterize (iOS 3.2+, but so is shadowOffset/etc):

    When the value of this property is YES, the layer is rendered as a bitmap in its local coordinate space and then composited to the destination with any other content. Shadow effects and any filters in the filters property are rasterized and included in the bitmap.

    You probably also want to set rasterizationScale appropriately.

提交回复
热议问题