CALayer - Shadow causes a performance hit?

后端 未结 5 1939
Happy的楠姐
Happy的楠姐 2020-12-13 02:33

So I am doing some custom animations on my navigationcontroller and the way it pushes and pops the viewControllers.

Everything runs smooth. As soon as I add the foll

5条回答
  •  别那么骄傲
    2020-12-13 03:09

    self.view.layer.shouldRasterize = YES;
    self.view.layer.rasterizationScale = UIScreen.mainScreen.scale;
    

    I was recently having some issues with slow CALayer shadows, and that simple line of code fixed up everything for me!

提交回复
热议问题