[英]Why is my iPad app not detecting orientation change?
Using the following code gives me nothing... My view rotates. 使用以下代码没有任何帮助...我的视图旋转。 Can't understand it... 听不懂...
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
NSLog(@"I am starting to rotate");
}
Thanks... 谢谢...
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
if(self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
self.interfaceOrientation == UIInterfaceOrientationLandscapeRight){
NSLog(@"I am starting to rotate in Landscape");
} else {
NSLog(@"I am starting to rotate in Portrait");
}
}
and leave this like how it was 并保持原样
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.