我发现旋转到横向时ECSlidingViewController,视图的大小没有调整。所以显示了一个大的空白背景。它在肖像中效果很好。
这只发生在右侧菜单上。
2014 年 5 月 20 日更新,子类 ECSlidingViewController,添加这 2 个方法。但问题仍然存在。
MyECSlidingViewController.m
-(BOOL)shouldAutorotate
{
return [self.topViewController shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [self.topViewController supportedInterfaceOrientations];
}
MenuLeftViewController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *menuItem = self.menuItems[indexPath.row];
self.slidingViewController.topViewController.view.layer.transform = CATransform3DMakeScale(1, 1, 1);
switch (indexPath.row)
{
case 0: // Home
self.slidingViewController.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"MainPageNavigationController"];
break;
case 1: // News
self.slidingViewController.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"NewsNavigationController"];
break;
case 2: // Songs
self.slidingViewController.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"SongsNavigationController"];
break;
case 3: // Notifications
self.slidingViewController.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PushNotificationNavigationController"];
break;
}
[self.slidingViewController resetTopViewAnimated:YES];
}