其中一个ViewController执行以下语句
UIViewController *vc = [[UIViewController alloc] init];
[self.navigationController pushViewController:vc animated:false];
将要被push的ViewController的viewDidLoad方法中,我init了一个textview和一个button,并且addSubview了,然后我在viewWillAppear方法中设置了他们的一点属性,用Masonry做了布局。
然后在第一次push的时候会产生卡顿,请问有什么方法避免?
PHP中文网2017-04-18 09:17:45
If the background color is not set (that is, the default background color), there may be lags. Try setting it to white. In addition, it may also be due to data binding that causes the view to be displayed only after the loading is completed. This should be called slow loading
巴扎黑2017-04-18 09:17:45
Since you have not posted the source code, you can refer to this batch of articles http://www.cocoachina.com/industry/20140114/7696.html
to conduct performance analysis and find out the cause of the lag.