如何更改 TTNavigator(对于网页网址)底部栏颜色?
这是我通过 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);
}
但我无法更改具有后退、前进、停止和刷新按钮的底部栏的颜色。
请任何人帮忙。必须这样做,因为我在许多应用程序中看到它以不同的颜色显示。
Here is a code i made to open a website via TTNavigator-
- (IBAction)btnTemp_Click{
TTNavigator* navigator = [TTNavigator navigator];
navigator.supportsShakeToReload = YES;
navigator.persistenceMode = TTNavigatorPersistenceModeAll;
[navigator openURLAction:[[TTURLAction actionWithURLPath:@"http://www.google.com"] applyAnimated:YES]];
}
and here i was able to manage its navigation bar items, color etc-
- (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);
}
but i am not able to change color of bottom bar that has back, fwd, stop and refresh bottons.
Anybody please help. It must be done because i saw this in different colors on many applications.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更改工具栏的颜色和样式应使用 TTStyleSheet 类来完成。
首先,您应该将 TTDefaultStyleSheet 扩展到您自己的类,并包含这些函数来更改
UINavigationBar
和较低的UIToolbar
的颜色:然后您应该加载样式表类进入您的应用程序委托:
changing the colors and style of the toolbars should be done using a TTStyleSheet class.
First, you should extend the TTDefaultStyleSheet to your own class and include these functions to change the colors for both the
UINavigationBar
and the lowerUIToolbar
:Then you should load your style sheet class into your app delegate:
谢谢阿帕拉特,
这是我所做的 -
命名
Stylesheet.h
和Stylesheet.m
.h
中导入#import
文件.m
文件中的UIViewController
替换为TTDefaultStyleSheet
,navigationBarTintColor
和 首先在项目委托文件中的toolbarTintColor
Stylesheet.h
然后在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary * 的第一行)launchOptions
我放置了[TTStyleSheet setGlobalStyleSheet:[[[Stylesheet alloc] init] autorelease]];
就是这样:)
Thanx aporat,
Here is the stuff i did-
name
Stylesheet.h
andStylesheet.m
#import <Three20Style/Three20Style.h>
in.h
fileUIViewController
withTTDefaultStyleSheet
.m
file i put the methodsnavigationBarTintColor
andtoolbarTintColor
Stylesheet.h
then on the 1st line of- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
i placed[TTStyleSheet setGlobalStyleSheet:[[[Stylesheet alloc] init] autorelease]];
THATS IT :)