我的視圖尺寸錯誤。我只運行橫向,但視圖報告縱向尺寸「視圖寬度= 768.000000高度= 1024.000000」任何想法如何解決這個問題?我已經打得四處自動旋轉我曾嘗試我的self.view尺寸錯誤
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft|| interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
和
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
它看起來就認爲很好,但有尺寸確實與我的應用程序搞亂。
如何獲取視圖的大小? – yuf
self.view.frame.size.width。等等。 – Jonathan
你什麼時候讀這個值? – yuf