How does ECSlidingViewController without storyboard?

综合技术 2018-02-14

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!

责编内容by:Hello, buddy! (源链)。感谢您的支持!

您可能感兴趣的

WPF text TextBlock modified notified I have a screen contain about 15-20 TextBlocks each one bind to a different property, at first all t...
Storyboard not found in style scope name The problem I'm having is that if I base a style on a second style that contains a storyboard, then ...
让 ScrollViewer 的滚动带上动画 WPF 的 ScrollViewer 没有水平滚动和垂直滚动的属性 HorizontalScrollOffset VerticalScrollOffset ,只有水平滚动和垂直滚动的方法 Scrol...
How to load a different storyboard for different i... Since the introduction of the iPad Pro range, we now have to deal with three distinct iPad screen si...
用Shape做动画(2):使用与扩展PointAnimation 上一篇几乎都在说DoubleAnimation的应用,这篇说说PointAnimation。 1. 使用PointAnimation 使用PointAnimation可以让Shape变形...