我正在处理由TabBar控制器组成的应用程序。 在它的选项卡中,我有一个UITableViewController的子类,在这个列表中,我在第一个单元格中有一个Core-plot图形,在下面的4个单元格中有一些其他数据。 当我在shouldAutorotateToInterfaceOrientation方法中返回YES时,我期望列表视图的自动调整发生,但是......什么也不做。 当我在willRotateToInterfaceOrientation方法中添加一些日志时,它们不会显示。 有什么我错过了吗? 非常感谢, 吕克iphone无法在TabBar控制器中旋转视图
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
//return (interfaceOrientation == UIInterfaceOrientationPortrait);
NSLog(@"Orientation");
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
NSLog(@"Rotating");
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
NSLog(@"view land:%@", self.view);
}
if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
{
NSLog(@"view portrait:%@", self.view);
}
}
非常感谢Luc – Luc 2010-06-19 21:05:02