-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
// UIImage *titleImage = [UIImage imageNamed:@"nav-l"];
// UIImage *joinImage = [UIImage imageNamed:@"join-port"];
self.navigationController.title = @"news";
self.navigationController.navigationBar.tintColor = [UIColor clearColor];
// [self.navigationController.navigationBar setBackgroundImage:titleImage forBarMetrics:UIBarMetricsDefault];
// self.navigationController.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"nav-l.png"]];
[self.navigationController.navigationBar setNeedsDisplay];
// navimg.image=titleImage;
// joinimg.image=joinImage;
} else {
// UIImage *titleImage = [UIImage imageNamed:@"nav-p"];
// UIImage *joinImage = [UIImage imageNamed:@"join-land"];
self.navigationController.navigationBar.tintColor = [UIColor clearColor];
// [self.navigationController.navigationBar setBackgroundImage:titleImage forBarMetrics:UIBarMetricsDefault];
// self.navigationController.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"nav-p.png"]];
[self.navigationController.navigationBar setNeedsDisplay];
// navimg.image=titleImage;
// joinimg.image = joinImage;
}
}
}
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
// UIImage *titleImage = [UIImage imageNamed:@"nav-l"];
// UIImage *joinImage = [UIImage imageNamed:@"join-port"];
self.navigationController.title = @"news";
self.navigationController.navigationBar.tintColor = [UIColor clearColor];
// [self.navigationController.navigationBar setBackgroundImage:titleImage forBarMetrics:UIBarMetricsDefault];
// self.navigationController.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"nav-l.png"]];
[self.navigationController.navigationBar setNeedsDisplay];
// navimg.image=titleImage;
// joinimg.image=joinImage;
} else {
// UIImage *titleImage = [UIImage imageNamed:@"nav-p"];
// UIImage *joinImage = [UIImage imageNamed:@"join-land"];
self.navigationController.navigationBar.tintColor = [UIColor clearColor];
// [self.navigationController.navigationBar setBackgroundImage:titleImage forBarMetrics:UIBarMetricsDefault];
// self.navigationController.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"nav-p.png"]];
[self.navigationController.navigationBar setNeedsDisplay];
// navimg.image=titleImage;
// joinimg.image = joinImage;
}
}
}
No comments:
Post a Comment