How can I know the orientation changed in AppDelegate

后端 未结 2 1234
说谎
说谎 2021-01-20 14:34

The function of how the device know the changement of orientation is -(void)viewWillLayoutSubviews and -(void)viewDidLayoutSubviews But, they are just in the controllers;

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-20 15:02

    If you are talking about the interface orientation you could observe theUIApplicationDidChangeStatusBarOrientationNotification and if you want to be notified when the device orientation changed you can observe UIDeviceOrientationDidChangeNotification

提交回复
热议问题