2010-07-15 46 views
3

所以,我在實現Three20 TTLauncherView時遇到了一些問題。我使用他們的代碼,而不是叉子(雖然我聽說過rodmaz的版本),我無法正常工作。這是我的應用程序的樣子。Three20 TTLauncher問題

alt text http://img709.imageshack.us/img709/8792/screenshot20100715at409.png

我刪除的圖標圖像,這不是問題。問題是,在頂部根本沒有導航欄,我相信也會導致底部的白色條帶,它看起來與導航欄具有相同的尺寸。我花了很長時間瀏覽他們的代碼,根本無法弄清楚這一點。看起來他們的導航欄(如他們的Catalog示例應用程序中所示)源自TTTableViewController,或者更進一步的東西。然而,我的應用程序開始像Facebook應用程序一樣,沒有放入表中,而是放入TTLauncherView。所以...如何將導航欄放到我的TTLauncher視圖中,如果它出現「App Delegate - > TTLauncherView Subclass」

感謝您的幫助!

編輯:

添加了我使用的代碼。我把它放在我的應用程序委託中,用UINavigation Controller封裝我的第一個視圖,並且它按照我的意願工作!

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]; 

回答

2

您只需之前有包裹導航欄認爲你推新的視圖。作爲一個例子,這裏是我的代碼片段,我介紹了一個帶有導航欄的模式視圖控制器。

- (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]; 

} 

如果你想添加任何按鈕或設置它的標題,你需要做的是,在視圖的viewDidLoad方法,你正在推動(即你的TTLauncher視圖)

+0

不是我的代碼最終使用,但你指出我在正確的方向。謝謝! – 2010-07-16 19:02:15

+0

不是問題,祝你好運! – iwasrobbed 2010-07-16 21:56:47

+0

你最終使用了什麼? – 2010-07-17 02:43:49