iOS 5: willRotateToInterfaceOrientation:duration not called when first loading controller

后端 未结 4 1161
花落未央
花落未央 2020-12-16 04:23

I\'ve implemented this method in my code to know when an interface orientation change will occur:

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrient         


        
4条回答
  •  一生所求
    2020-12-16 04:44

    Since iOS 5 and higher you should build you view controllers hierarchy (using -addChildViewController:). Then child view controllers begin to call -willRotateToInterfaceOrientation:interfaceOrientation: and other interface related methods again (because parent controller will notify them about UI orientation changes).

    Please, do not use any 'dirty' methods.

    Useful documentation: Apple docs about 'addChildViewController:'

提交回复
热议问题