ECSlidingViewController 2横屏加右侧菜单存在问题

3
我发现当旋转到横屏时,ECSlidingViewController的视图大小没有调整,导致出现一个大的空白背景。在竖屏模式下运行良好。这只在右侧菜单中发生。
请在此处查看屏幕截图: landscapeportrait
更新于2014年5月20日,子类化ECSlidingViewController,添加这两个方法,但问题仍然存在。

storyboard key path of 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];
}

展示一些代码。视图包含什么?你使用了哪种自动调整大小/布局?它与左侧视图有何不同? - Wain
请查看两个新的屏幕截图。我使用Storyboard从左侧或右侧菜单连接到每个UINavigationController。ECSlidingViewController的默认方法是在menuViewController中替换topViewController。 - user3491799
1个回答

1
尝试设置shouldAutorotatesupportedInterfaceOrientations。如果您尝试为不同页面设置不同的方向,则是另一回事。在我看来,目前EC似乎无法实现这一点。例如,纵向的框架与横向的框架不同。但是,当topviewcontroller被替换时,旧框架仅适用于新的topviewcontroller。当所有视图控制器支持相同的模式时,这不是问题。但是,如果某些视图控制器与其他视图控制器相比受到限制,则进入其中之一会导致错误的呈现。希望在EC 2.0中修复此问题。

我已经对ECSlidingViewController进行了子类化,但它并没有起作用。 - user3491799

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接