pushviewcontroller animation is slow/choppy

前端 未结 8 1319
無奈伤痛
無奈伤痛 2020-12-13 00:32

I push a ViewController which contains not too many views, UIScrollView which contains 10 views inside, I have a singleton ViewController

相关标签:
8条回答
  • 2020-12-13 01:27

    Swift: If you are applying shadow on any view etc then you can also try below code for this.

    view.layer.shouldRasterize = true
    view.layer.rasterizationScale = UIScreen.main.scale
    
    0 讨论(0)
  • 2020-12-13 01:28

    I had this problem, and it was because of old code in the pushed view controller, which caused the view to "fade in", setting the alpha to 0 on viewWillAppear and setting the alpha to 1 on viewDidAppear.

    I removed the old code that did this, and the push worked fine.

    -(void)viewWillAppear {
        self.view.alpha = 0; //REMOVE THIS LINE
    }
    
    0 讨论(0)
提交回复
热议问题