3

我发现旋转到横向时ECSlidingViewController,视图的大小没有调整。所以显示了一个大的空白背景。它在肖像中效果很好。

这只发生在右侧菜单上。

请在此处找到屏幕截图: 风景肖像

2014 年 5 月 20 日更新,子类 ECSlidingViewController,添加这 2 个方法。但问题仍然存在。

故事板 MyECSlidingViewController 的关键路径

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];
}
4

1 回答 1

1

尝试设置 shouldAutorotate supportedInterfaceOrientations
如果您尝试以不同的方式设置不同页面的方向,则另当别论。
在我看来,目前 EC 似乎无法做到这一点。例如,纵向框架与横向框架不同。但是当顶视图控制器被替换时,旧框架只是应用于新的顶视图控制器。

当所有视图控制器都支持相同的模式时,这不是问题。但是,如果某些与其他相比是有限的,那么输入其中一个会给出错误的呈现

希望它在 EC 2.0 中得到修复。

于 2014-05-17T10:21:38.573 回答