开发者

Three20 library - subclass of TTPhotoViewController has an opaque navigation bar

I am using a TTPhotoViewController subclas开发者_高级运维s from the Three20 library for showing images from a web location. The images load up fine but the navigation bar and toolbar show up with the default tint. I am using a nav bar with a custom tint (set in the MainWindow.xib)

I tried these things to get it to show black translucent bars but none of these seem to work.

  1. setting the navigation bar style to black translucent in MainWindow.xib
  2. setting the navigation bar style to black opaque in MainWindow.xib
  3. Explicitly setting the navigationbar style to black translucent in the subclass's viewWillAppear:

Can someone please tell me why this would happen and how I can solve this? Thanks.


EDIT: I'm an idiot. You're trying to set the style, not the color. The below is all valid information, but what you almost certainly want is the navigationBarStyle property defined by TTViewController. Sorry.


Three20 has a "style sheet" mechanism built into it, the intended purpose of which is to save you from having to set tint colors, fonts, etc. on all of the many UI objects in your app, over and over. However, if you don't know it's there, you end up in exactly this situation. What you need to do is:

Create a subclass of TTDefaultStyleSheet in your application, and override at least this method:

- (UIColor*)navigationBarTintColor {
  return RGBCOLOR(119, 140, 168);
}

Someplace in your app (probably applicationDidFinishLaunching:), call:

[TTStyleSheet setGlobalStyleSheet:
  [[[YourStyleSheetClass alloc] init] autorelease]];

(You might want to browse around in TTDefaultStyleSheet.h, because there are a whole pile of other styles defined there that are used by the framework, and that you might also want to override.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜