Ho creato una categoria per la rotazione della vista e ho aggiunto viste sulla vista del controller e sulla finestra (per mostrare l'indicatore personalizzato). Il mio codice funziona bene fino a 7.X con xCode 5.X e xCode6-beta6. Ma non è corretto con IOS 8 beta. Sembra che la rotazione di Windows non funzioni con ios 8 beta come gli ios più vecchi.Problema di rotazione con iOS 8 per la vista che viene aggiunta a windows
Potete per favore suggerirmi .... Grazie mille in anticipo.
Il mio codice è assomigliare
- (void)application:(UIApplication *)application willChangeStatusBarOrientation:(UIInterfaceOrientation)newStatusBarOrientation duration:(NSTimeInterval)duration {
if(!self.isIpad)
{
[menu.view rotateViewToOrientation:newStatusBarOrientation animated:YES];
if(newStatusBarOrientation==UIInterfaceOrientationPortrait || newStatusBarOrientation==UIInterfaceOrientationPortraitUpsideDown)
{
if (IS_IPHONE_5) {
menu.view.frame= CGRectMake(0, 518, 320, 50);
} else {
menu.view.frame= CGRectMake(0, 430, 320, 50);
}
} else if(newStatusBarOrientation==UIInterfaceOrientationLandscapeLeft) {
if (IS_IPHONE_5) {
menu.view.frame= CGRectMake(270,0,50,568);
} else {
menu.view.frame= CGRectMake(270,0,50,480);
}
} else {
if (IS_IPHONE_5) {
menu.view.frame= CGRectMake(0,0,50,568);
} else {
menu.view.frame= CGRectMake(0,0,50,480);
}
}
[menu reloadMenu];
}
}
//Method of Menu Class for orientation change setup
- (void)rotateViewToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
CGPoint center = self.center;
CGRect bounds = self.bounds;
CGAffineTransform transform = CGAffineTransformIdentity;
int intOri=orientation;
switch (intOri) {
case UIInterfaceOrientationPortraitUpsideDown:
transform = CGAffineTransformMakeRotation(M_PI);
break;
case UIInterfaceOrientationLandscapeLeft:
transform = CGAffineTransformMakeRotation(-M_PI_2);
break;
case UIInterfaceOrientationLandscapeRight:
transform = CGAffineTransformMakeRotation(M_PI_2);
break;
case UIInterfaceOrientationPortrait:
transform = CGAffineTransformMakeRotation(0);
break;
}
if (animated) {
[UIView beginAnimations:nil context:nil];
}
self.transform = transform;
bounds = CGRectApplyAffineTransform(bounds, transform);
self.bounds = CGRectMake(0, 0, bounds.size.width, bounds.size.height);
self.center = center;
if (animated) {
[UIView commitAnimations];
}
}
incollare un codice e mostrare come ottenere è problema, c'è qualche funzione non sta chiamando o qualsiasi altra cosa ?? – Jageen
in generale la maggior parte degli sviluppatori non ha idea di come si debba costruire una corretta gerarchia delle viste e che possa essere l'origine del problema - potresti pubblicare del codice su come costruisci il tuo? – holex
@Jageen Ho aggiunto il mio codice, puoi suggerirmi in qualsiasi modo, Cosa dovrei seguire per rendere compatibile la mia applicazione iOS 8. –