У меня есть приложение Ipad, которые поддерживают в режиме «ландшафтной» Теперь я хочу, чтобы это поддержка для обоих файлов «XIb», «пейзаж и портрет» этот проект выполнен сориентация в ИО IPad
я использовал некоторые делегаты, но я не получил решение, что я должен делать я использую этот код
- (void)viewWillTransitionToSize:(CGSize)size
withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
//The device has already rotated, that's why this method is being called.
UIInterfaceOrientation toOrientation = [[UIDevice currentDevice] orientation];
//fixes orientation mismatch (between UIDeviceOrientation and UIInterfaceOrientation)
if (toOrientation == UIInterfaceOrientationLandscapeRight) toOrientation = UIInterfaceOrientationLandscapeLeft;
else if (toOrientation == UIInterfaceOrientationLandscapeLeft) toOrientation = UIInterfaceOrientationLandscapeRight;
UIInterfaceOrientation fromOrientation = [[UIApplication sharedApplication] statusBarOrientation];
[self willRotateToInterfaceOrientation:toOrientation duration:0.0];
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
[self willAnimateRotationToInterfaceOrientation:toOrientation duration:[context transitionDuration]];
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
[self didRotateFromInterfaceOrientation:fromOrientation];
}];
}
-(void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
NSLog(@"Transition");
}
любые другие методы я должен Райта или любая вещь, я должен изменить мне помочь – Mahesh
любая помощь будет оценена и upvoted – Mahesh
прочитать http://goo.gl/Y3cyps, здесь вы найдете ответы. –