这是我通过TTNavigator打开一个网站的代码-
- (IBAction)btnTemp_Click{
TTNavigator* navigator = [TTNavigator navigator];
navigator.supportsShakeToReload = YES;
navigator.persistenceMode = TTNavigatorPersistenceModeAll;
[navigator openURLAction:[[TTURLAction actionWithURLPath:@"http://www.google.com"] applyAnimated:YES]];
}在这里我可以管理它的导航栏项目,颜色等等-
- (void)addSubcontroller:(UIViewController *)controller animated:(BOOL)animated transition:(UIViewAnimationTransition)transition
{
[self.navigationController addSubcontroller:controller animated:animated transition:transition];
UIButton *btnBack = [UIButton buttonWithType:UIButtonTypeCustom];
[btnBack setImage:[UIImage imageNamed:@"navback.png"] forState:UIControlStateNormal];
[btnBack addTarget:self action:@selector(popThisView) forControlEvents:UIControlEventTouchUpInside];
[btnBack setFrame:CGRectMake(0, 0, 32, 32)];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btnBack];
UIBarButtonItem *backBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btnBack];
[controller.navigationItem setLeftBarButtonItem:backBarButtonItem animated:YES];
[btnBack release];
TT_RELEASE_SAFELY(backBarButtonItem);
}但是我不能改变底部栏的颜色,它有back,fwd,stop和refresh bottons。
任何人请帮帮忙。这是必须的,因为我在许多应用程序中看到了不同的颜色。
发布于 2011-09-23 07:05:57
应该使用TTStyleSheet类来更改工具栏的颜色和样式。
首先,您应该将TTDefaultStyleSheet扩展到您自己的类中,并包含这些函数来更改UINavigationBar和较低UIToolbar的颜色
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark -
#pragma mark TTDefaultStyleSheet
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UIColor*)navigationBarTintColor {
return RGBCOLOR(0, 60, 30);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UIColor*)toolbarTintColor {
return RGBCOLOR(0, 60, 30);
}然后,您应该将样式表类加载到您的应用程序委托中:
[[[TTStyleSheet setGlobalStyleSheet:[[[StyleSheet alloc] init] autorelease]];发布于 2011-09-26 16:20:07
感谢阿波拉特,这是我做的事情-
在Stylesheet.m
Stylesheet.h和Stylesheet.m#import <Three20Style/Three20Style.h>,然后在.h文件中使用toolbarTintColorUIViewController。我先将方法放入< .m >d15和viewcontroller项目委派文件,然后将Stylesheet.h放在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions的第1行这就是它:)
https://stackoverflow.com/questions/7513849
复制相似问题