views:

44

answers:

1

So, I'm having some issues with my implementation of the Three20 TTLauncherView. I am using their code, not a fork (although I have heard of rodmaz's version), and I can't get it to work properly. This is what my app looks like.

alt text

I removed the icon image, that's not the issue. The issue is, at the top there is no Navigation bar at all, and I believe also causes the white strip at the bottom, which appears to have the same dimensions as a Nav Bar. I've spent quite a while looking through their code and can't figure this out at all. It looks like their Navigation bar (as seen in their Catalog example app) stems from the TTTableViewController, or something further up. However, my app starts like the Facebook app does, not into a table, but into the TTLauncherView. So... how do I get the Navigation bar into my TTLauncher view, if it goes "App Delegate -> TTLauncherView Subclass"

Thanks for your help!

Edit:

Added the code I used. I put this in my app delegate, wrapping my first view with the UINavigation Controller, and it worked just as I wanted!

MainViewController *aController = [[MainViewController alloc] initWithNibName:nil bundle:nil]; //my Main view
self.mainViewController = aController;
[aController release]; //release for Memory Management
self.mainViewController.view.frame = [UIScreen mainScreen].applicationFrame;

UINavigationController *navigationController = [[UINavigationController alloc] init];
[navigationController pushViewController:self.mainViewController animated:NO]; //Gets the main view on the screen

[window addSubview:navigationController.view];
A: 

You simply wrap the view with a navigation bar before you push the new view. As an example, here is a snippet of my code where I present a modal view controller with a navigation bar.

- (IBAction) showNewNavView: (id) sender 
{

    // Present it as a modal view and wrap the controller in a navigation controller to provide a navigation bar for the Edit and Save buttons
    ModalViewController *addController = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil];
    addController.delegate = self;

    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addController];
    navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;

    [self presentModalViewController:navigationController animated:YES];

    [navigationController release];
    [addController release];

}

If you want to add any buttons or set the title of it, you need to do that in the viewDidLoad method of the view that you are pushing (i.e. your TTLauncher view)

iWasRobbed
Not the code I ended up using, but you pointed me in the right direction. Thank you!
Wayfarer
Not a problem, best of luck!
iWasRobbed
What did you end up using?
Michael Grinich
Added the code to the OP.
Wayfarer