objective-c - ios页面跳转有点卡顿
PHP中文网
PHP中文网 2017-04-18 09:15:45
0
12
799

其中一个ViewController执行以下语句

UIViewController *vc = [[UIViewController alloc] init];
[self.navigationController pushViewController:vc animated:false];

将要被push的ViewController的viewDidLoad方法中,我init了一个textview和一个button,并且addSubview了,然后我在viewWillAppear方法中设置了他们的一点属性,用Masonry做了布局。
然后在第一次push的时候会产生卡顿,请问有什么方法避免?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(12)
洪涛

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

巴扎黑

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template