将多个控制器的View添加到scrollView中,就第一次进入的时候会走ViewDidAppear方法,滑动屏幕为什么不走ViewDidDisapper或者ViewDidAppear方法?
PHP中文网2017-04-18 09:46:00
If you directly add the view in the viewController to the view controlled by another controller using the addSubView method, in this case, because the view has left the control scope of the original controller, the callbacks related to the display and hiding of the view will not be available. It worked. It needs to be handled manually under the current controller, such as manually calling the viewDidDisappear method of the controller corresponding to that view when sliding the scrollView to a certain range, etc.
It is recommended to use childViewController.
PHPz2017-04-18 09:46:00
Sliding the screen does not remove the controller and the views it controls. Of course it does not ViewDidDisapper