IOS developers can achieve screen rotation in two ways;
1. LoadShouldautorotate andShouldautorotatetointerfaceorientation two methods, of course, there is a difference between ios6 and the previous version. For details, see "ios6 screen rotation details (automatic rotation, manual rotation, and systems compatible with ios6 )".Article.
The specific method is generally based on
The statusbarorientation method is used to determine the current landscape and landscape, and then set the View frame. In the rotation function that you overload, set the frame of the view based on the portrait screen again.
2. You can also customize a class for the view to be loaded. The layout of images and other resources in this view is all implemented in layoutsubviews. Add this view to vontroller and set
Autoresizingmask=
Uiviewautoresizingflexiblewidth|Uiviewautoresizingflexibleheight, use the bounds of the congtroller view to initialize the view (call initwithframe), and set the userinteractionenabled of the view.=No. In this way, other view response events in the Controller will not be blocked. In this way, the view is automatically rotated.