0
虽然在模拟器中问题不存在,但我在自动旋转到横向后出现问题。当我以纵向方式加载应用时,所有工作都正常,但是当我旋转设备(iPod touch 1st gen。3.1.3)以使横向效果为:http://imageshack.us/photo/my-images/155/img0021n.png/。 如果我切换到第二个视图(“Riepilogo”,即表格视图),然后回到第一个视图,视图完全适合横向,但是如果再次旋转到纵向,问题与上述相同。查看不适合旋转后的屏幕
这里是shouldAutorotateToInterfaceOrientation的代码:
- (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation{
if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) {
[self.scrollView setContentSize: CGSizeMake(480,416)];
} else {
[self.scrollView setContentSize: CGSizeMake(320, 416)];
}
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); }
P.S.该视图是UIScrollView的一个实例
那我该怎么办? – Lolloz89
滚动视图具有子视图。调整你想调整大小的那些。 – NSResponder