我想适应我的应用程序到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