-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{ if (toInterfaceOrientation==UIInterfaceOrientationPortrait) { self.view = self.portraitView; CGAffineTransform transform = CGAffineTransformMakeRotation(0); self.view.transform = transform; } /*if (toInterfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) { self.view = self.portraitView; CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159); self.view.transform = transform; } */ if (toInterfaceOrientation==UIInterfaceOrientationLandscapeRight) { self.view = self.landscapeView; CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2); self.view.transform = transform; } if (toInterfaceOrientation==UIInterfaceOrientationLandscapeLeft) { self.view = self.landscapeView; CGAffineTransform transform = CGAffineTransformMakeRotation(-(3.14159/2)); self.view.transform = transform; } }lecz to rozwiązanie nie jest najlepsze gdyż nie bardzo można powielać Outlety w tym przypadku. Najlepiej było by zrobić oddzielny plik xib dla landscape ale tu pojawia się mój problem, jak później odpowiednio go wywołać tak by działało to na iOS5 i iOS6 z góry dzięki za pomoc.
Oddzielny xib dla landscape iOS5/iOS6
Rozpoczęty przez
Zuki
, 24 paź 2012 14:57
Brak odpowiedzi do tego tematu
#1
Napisano 24 października 2012 - 14:57
Witam
Apple w iOS6 zrezygnowało z:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
na rzecz
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
i tu rodzi sie problem chce zrobić oddzielny widok dla pracy w landscape obecnie porostu umieściłem dodatkowy widok w pliku xib a następnie rozwiązałem to w ten sposób:
Użytkownicy przeglądający ten temat: 2
0 użytkowników, 2 gości, 0 anonimowych