我想適應我的應用程序到iPhone 5的視網膜4屏幕,並添加png存檔和一切調整大小,但地圖視圖,移動到頂部,並留下一個白色方形底部。我想知道如何解決它。iphone 5視網膜4英寸mapview
在此先感謝。
也許這有什麼關係呢?
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// We need to manually handle rotation on iPads running iOS 5 and higher to support the new UINavigationBar customization. This is automatic on the iPhone & iPod Touch.
if ([self.navigationController.navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)]) {
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"[email protected]"] forBarMetrics:UIBarMetricsDefault];
}
else {
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"[email protected]"] forBarMetrics:UIBarMetricsDefault];
}
}
}
else {
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
[mapView setFrame:CGRectMake(0, 0, 480, 236)];
[toolbar setFrame:CGRectMake(0, 236, 480, 32)];
}
else {
[mapView setFrame:CGRectMake(0, 0, 320, 372)];
[toolbar setFrame:CGRectMake(0, 372, 320, 44)];
}
嗨,約翰,我按照你所說的來固定一切......但它沒有改變。也嘗試與iOS 6.1 alutolayout ...沒有。感謝您的建議:) – Icarox 2013-05-03 17:52:51
我給這個問題添加了一些代碼...我認爲這是重點。 – Icarox 2013-05-03 17:57:17
那麼你很難編碼你的用戶界面的框架。你不應該那樣做。既然你的目標是iOS 5,你應該使用spring和struts來解決這個問題。或者檢查iPhone 5的尺寸並改變框架。 – John 2013-05-07 12:11:52