ここに興味深い問題があります。iPhoneには、画面の下部にツールバーがあるビューが設定されています。私は現在、これをユニバーサルアプリにして、iPadでも動作するようにしようとしています。ツールバーをiPad画面の上部に配置したいので、特定のviewControllerのviewDidLoadメソッドに次のコードがあります。
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
//move the toolbar to the top of the page and move the webview down by the height of the toolbar
CGRect toolBarFrame = self.aToolBar.frame;
CGRect webFrame = self.aWebView.frame;
webFrame.origin.y = toolBarFrame.size.height;
[self.aWebView setFrame:webFrame];
toolBarFrame.origin.y = 0;
[self.aToolBar setFrame:toolBarFrame];
[Utils errorString:[NSString stringWithFormat:@"origen: x=%f y=%f", self.aToolBar.frame.origin.x, self.aToolBar.frame.origin.y]];
[Utils errorString:[NSString stringWithFormat:@"origen: x=%f y=%f", self.aWebView.frame.origin.x, self.aWebView.frame.origin.y]];
}
私が抱えている問題は、webViewが正常に下に移動することですが、ツールバーはiPhone画面の高さ程度までしか上に移動しません。errorStringを呼び出すと、webViewの原点が0.44(あるべき場所)にあり、ツールバーの原点が0,0にあることがわかりますが、実際には画面の中央のどこかにあります。
誰かがここで何が起こっているのか手がかりを持っていますか?