How does ECSlidingViewController without storyboard?

I want to use ECSlidingViewController in my iOS 4.3 applications. And I wonder how to apply this library without storyboard?

PLZ, how to? this is my code, but iOS simulator’s screen is white only.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    //self.window.backgroundColor = [UIColor whiteColor];

    FrontViewController *frontViewController = [[FrontViewController alloc] initWithNibName:@"FrontViewController" bundle:nil];
    RearViewController *rearViewController = [[RearViewController alloc] initWithNibName:@"RearViewController" bundle:nil];

    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController];

    // create a DDMenuController setting the content as the root
    //DDMenuController *menuController = [[DDMenuController alloc] initWithRootViewController:navigationController];
    //menuController.leftViewController = rearViewController;

    //RevealController *menuController = [[RevealController alloc] initWithFrontViewController:navigationController rearViewController:rearViewController];

    ECSlidingViewController *slidingViewController = (ECSlidingViewController *)self.window.rootViewController;
    slidingViewController.topViewController = navigationController;
    slidingViewController.underLeftViewController = rearViewController;

    self.window.rootViewController = slidingViewController;
    [self.window makeKeyAndVisible];
    return YES;
}

Here is your code

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

// Override point for customization after application launch.
FrontViewController *frontViewController = [[FrontViewController alloc] initWithNibName:@"FrontViewController" bundle:nil];
RearViewController *rearViewController = [[RearViewController alloc] initWithNibName:@"RearViewController" bundle:nil];

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController];

ECSlidingViewController *slidingViewController = [[ECSlidingViewController alloc] init];
slidingViewController.topViewController = navigationController;
slidingViewController.underLeftViewController = rearViewController;

self.window.rootViewController = slidingViewController;
[self.window makeKeyAndVisible];
return YES;
}
Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 移动开发 » How does ECSlidingViewController without storyboard?

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录