for the query of methods of rotation
I have 1 UIViewController.
in that i wrote,
- (void)willRotate开发者_如何学GoToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
NSLog(@"A");
} in UIViewController.
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
NSLog(@"b");
}
but this method is not called why is it so?
You may need to do two things:
- Tell device to track orientation changes: call
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
- Implement your View controllers
-shouldAutorotateToInterfaceOrientation
method - return YES for orientations you want to support.
精彩评论