Three20 library - subclass of TTPhotoViewController has an opaque navigation bar

前端 未结 1 1824
南方客
南方客 2021-02-03 14:11

I am using a TTPhotoViewController subclass from the Three20 library for showing images from a web location. The images load up fine but the navigation bar and toolbar show up w

1条回答
  •  再見小時候
    2021-02-03 14:53

    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 讨论(0)
提交回复
热议问题