Я пытаюсь адаптировать свое приложение к экрану сетчатки 4 для iPhone 5 и добавлять архив png, и все изменяется, но вид карты, который перемещается вверх и оставляет белый квадрат на дно. Я хотел бы знать, как это исправить.iphone 5 retina 4 inch 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)];
}
Привет, Джон, я поставил на якорь все, как вы сказали ... но это не изменилось. Также попробуйте alutolayout с iOS 6.1 ... и ничего. Спасибо за совет в любом случае :) – Icarox
Я добавил код на вопрос ... Я думаю, что есть смысл. – Icarox
Ну, вы жёстко кодируете рамки вашего интерфейса. Вы не должны этого делать. Поскольку вы ориентируетесь на iOS 5, вам следует использовать пружины и распорки для этой проблемы. Или проверьте размеры iPhone 5 и измените рамку таким образом. – John