2011-10-11 90 views
0

请参阅我的这个职位how to change TTNavigator (for a web url) bottom bar color?如何禁用TTNavigator工具栏按钮?

现在我必须禁用'在Safari中打开'选项到同一个控制器。请给我一个方法。我无法找到使用样式来做到这一点。我知道这是可能的,因为我已经看到了几个应用程序的选项。

请帮助...

+0

你的意思是TTWebController的工具栏? – aporat

+0

我困惑吗?我没有在任何地方使用“TTWebViewController”。 我正在使用的是 - TTNavigator * navigator = [TTNavigator navigator]; navigator.supportsShakeToReload = YES; navigator.persistenceMode = TTNavigatorPersistenceModeAll; [navigator openURLAction:[[TTURLAction actionWithURLPath:@“http://www.google.com”] applyAnimated:YES]]; 打开一个网站,这只是在safari中打开一个网站看起来像一个webview。我应该使用“TTWebViewController”吗?请详细说明... –

回答

2

在默认情况下,TTNavigator会转发不匹配TTWebController的网址。

所以,如果你想改变Web视图,你将不得不继承TTWebController到自己的类,并在应用程序委托添加映射:

要卸下萨法尔操作按钮打开,你可以添加以下功能自定义TTWebController你继承:

/////////////////////////////////////////////////////////////////////////////////////////////////// 
- (void)loadView { 
    [super loadView]; 

    TT_RELEASE_SAFELY(_toolbar); 

    _toolbar = [[UIToolbar alloc] initWithFrame: 
       CGRectMake(0, self.view.height - TTToolbarHeight(), 
         self.view.width, TTToolbarHeight())]; 
    _toolbar.autoresizingMask = 
    UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth; 
    _toolbar.tintColor = TTSTYLEVAR(toolbarTintColor); 
    _toolbar.items = [NSArray arrayWithObjects: 
        _backButton, 
        space, 
        _forwardButton, 
        space, 
        _refreshButton, 
        nil]; 
    [self.view addSubview:_toolbar]; 

}

,并在您的应用程序代理包罗万象的映射规则:

[map from:@"*" toViewController:[CustomWebController class]];