开发者

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:

  1. Tell device to track orientation changes: call [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
  2. Implement your View controllers -shouldAutorotateToInterfaceOrientation method - return YES for orientations you want to support.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜