Process screen rotation and screen Rotation
1. Get the HOME Key direction
The View Controller itself can detect screen rotation. If you want to handle screen rotation, you need to override the method.
SupportedInterfaceOrientations (sets the method in which the device supports rotation. If not added, the View Controller cannot detect screen rotation)
Keyboard reclaim after rotation
-(Void) viewWillTransitionToSize :( CGSize) size withTransitionCoordinator :( id <UIViewControllerTransitionCoordinator>) coordinator
The view Controller automatically adjusts the view Size to adapt to screen rotation. The bounds is modified to trigger the layoutSubviews method of the view.
Therefore, the layoutSubviews method is rewritten to relay the layoutSubviews according to the device direction.
LayoutSubviews method: This method does not do anything by default, and must be rewritten by subclass.
Note: layoutSubviews are called in the following cases:
2. Get the direction of the status bar
[UIApplication sharedApplication]. statusBarOrientation