【问题标题】:Three20 TTLauncher IssuesThree20 TTLauncher 问题
【发布时间】:2023-03-22 03:27:01
【问题描述】:

所以,我在实施 Three20 TTLauncherView 时遇到了一些问题。我使用的是他们的代码,而不是 fork(虽然我听说过 rodmaz 的版本),但我无法让它正常工作。这就是我的应用的样子。

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

我删除了图标图像,这不是问题。问题是,顶部根本没有导航栏,我相信也会导致底部出现白色条带,它的尺寸似乎与导航栏相同。我花了很长时间查看他们的代码,但根本无法弄清楚。看起来他们的导航栏(如在他们的目录示例应用程序中所见)源于 TTTableViewController,或者更进一步。但是,我的应用程序启动 就像 Facebook 应用程序一样,不是进入表格,而是进入 TTLauncherView。那么......如果导航栏进入“App Delegate -> TTLauncherView Subclass”,我如何将导航栏放入我的 TTLauncher 视图中

感谢您的帮助!

编辑:

添加了我使用的代码。我把它放在我的应用程序委托中,用 UINavigation 控制器包装我的第一个视图,它就像我想要的那样工作!

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

【问题讨论】:

    标签: iphone objective-c three20 ttlauncherview


    【解决方案1】:

    您只需在推送新视图之前用导航栏包裹视图。例如,这是我的代码的 sn-p,其中我展示了一个带有导航栏的模态视图控制器。

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

    如果您想添加任何按钮或设置其标题,您需要在您正在推送的视图(即您的 TTLauncher 视图)的 viewDidLoad 方法中执行此操作

    【讨论】:

    • 不是我最终使用的代码,但您为我指明了正确的方向。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多