Witam Mam problem z obracaniem się Modala przedstawionego ViewController w iOS8. Wszystko to działa dobrze na iOS7 i niższe.iOS8 Modal ViewController Problem z obracaniem
Struct App:
- RootController (obsługiwane Orientacja: Pionowa)
- Modal Prezentowane ViewController (obsługiwane Kierunek: Wszystkie)
Mój problem jest kiedy Obróć urządzenie, gdy kontroler modalne jest przedstawiony widok kontrolera Modal nie został zmieniony na ramkę lanscape.
wygląda tak:
Metody obrotowe nazwano a gdy ustawienie ramki w celu krajobrazu ręcznie interakcji użytkownika z prawej strony (sito szara) nie działa.
kod RootController:
kod- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}
- (NSUInteger) supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
Modal Kontroler:
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration
{
if (self.presentingViewController != nil) {
[self.presentingViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
duration:duration];
}
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration
{
if (self.presentingViewController != nil) {
[self.presentingViewController willRotateToInterfaceOrientation:toInterfaceOrientation
duration:duration];
}
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if (self.presentingViewController != nil) {
[self.presentingViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
}
}
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
}];
}
Może ktoś mi pomóc rozwiązać ten problem dla systemów iOS 8.
Czy ustawiłeś automatyczne maskowanie na swoich elementach interfejsu użytkownika? – Jasper