0

请在我的项目中帮助我。我正在使用IIViewDeckController,但当被视图控制器推送时它不起作用

继承人的层次结构:

ViewController(推)----> IIViewDeckController(左视图和中心视图)。

这是我初始化 IIViewDeckController 时的代码:

- (IIViewDeckController*)generateControllerStack{

self.navigationView = [[NavigationViewController alloc] initWithNibName:@"NavigationViewController" bundle:nil];
self.profileView = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];

UINavigationController* navC = [[UINavigationController alloc] initWithRootViewController:self.profileView];


IIViewDeckController *deckView = [[IIViewDeckController alloc] initWithCenterViewController:navC leftViewController:self.navigationView rightViewController:nil];

deckView.leftSize = 50;

[deckView disablePanOverViewsOfClass:NSClassFromString(@"_UITableViewHeaderFooterContentView")];

return deckView;

}

那么这是我使用另一个 ViewController 推送 IIViewDeckController 时的代码

- (IBAction)signInAction:(id)sender {

IIViewDeckController *deckView = [[UIManager sharedItems] generateControllerStack];

[self.navigationController pushViewController:deckView animated:YES];

}

非常感谢你们:)

在此处输入图像描述

当我单击登录时,我将使用左视图和中视图推送我的 iiviewdeckcontroller,这会出现

在此处输入图像描述

4

3 回答 3

0

你可以那样做。

//Appdelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController"
                                                       bundle:nil];
UINavigationController *navigation = [[UINavigationController alloc]initWithRootViewController:self.viewController];
self.window.rootViewController = navigation;
[self.window makeKeyAndVisible];
return YES;

}

然后导入IIViewDeckController.h_ViewController.h

- (IBAction)GoToNext:(id)sender 
{
        IIViewDeckController *objIIVC = [self.storyboard instantiateViewControllerWithIdentifier:@"Your VC's Identifier"];
        [self.navigationController pushViewController:objIIVC animated:YES];

}
于 2015-10-06T07:21:58.587 回答
0

Did you created it like this? I am using it as root view controller. and it is working fine

    UINavigationController* navController=(UINavigationController*)[[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"HomeViewController"];

    SlideMenuViewController* slide=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"SlideMenuViewController"]; /


    IIViewDeckController* deckController =  [[IIViewDeckController alloc] initWithCenterViewController:navController
                                                                                    leftViewController:slide
                                                                                   rightViewController:nil
                                                                                     topViewController:nil
                                                                                  bottomViewController:nil];

    float leftSize=self.window.frame.size.width - (88*self.window.frame.size.width)/320;
    deckController.panningMode = IIViewDeckFullViewPanning;
    deckController.leftSize =leftSize;
于 2015-10-06T07:27:53.520 回答
0

这是我的代码

- (IIViewDeckController*)generateControllerStack{

self.navigationView = [[NavigationViewController alloc] initWithNibName:@"NavigationViewController" bundle:nil];


UIViewController *centerController = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
centerController = [[UINavigationController alloc] initWithRootViewController:centerController];


self.viewDeck = [[IIViewDeckController alloc] initWithCenterViewController:centerController leftViewController:self.navigationView rightViewController:nil topViewController:nil bottomViewController:nil];

self.viewDeck.leftSize = 50;

[self.viewDeck disablePanOverViewsOfClass:NSClassFromString(@"_UITableViewHeaderFooterContentView")];

return self.viewDeck;

}

于 2015-10-06T07:40:33.337 回答