代码之家  ›  专栏  ›  技术社区  ›  Pugalmuni Tom Tharakan

如何在iPhone中使用Three20更改TTPhotoviewcontroller中的导航栏颜色

  •  1
  • Pugalmuni Tom Tharakan  · 技术社区  · 15 年前

    我想使用Three20更改TTPhotoviewcontroller中的导航颜色。我已更改TTPhotoviewcontroller中的颜色,但该视图中未设置图像。如果我更改了颜色,导航栏会占用一些位置,并且图像不会设置为全视图。

    在TTPhotoViewController.m中,

          - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
                if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
                   self.statusBarStyle = UIStatusBarStyleBlackTranslucent;
                   self.navigationBarStyle = UIBarStyleBlackTranslucent;
                   self.navigationBarTintColor = nil;
                 ( if i use this below code, image is doesn't set to the full view in TTPhotviewcontroller )
                   // self.navigationBarTintColor = [UIColor colorWithRed:34/256.0 green:125/256.0 blue:144/256.0 alpha:1.0];   
                  // self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:34/256.0 green:125/256.0 blue:144/256.0 alpha:1.0];
                      self.wantsFullScreenLayout = YES;
                      self.hidesBottomBarWhenPushed = YES
                      return self;
            }
    

    所以请帮帮我。

    谢谢!

    2 回复  |  直到 14 年前
        1
  •  1
  •   Flexo - Save the data dump sunny moon    13 年前
    self.navigationController.navigationBar.translucent=YES;
    
    self.navigationBarTintColor = RGBCOLOR(111,63,35);
    
    self.statusBarStyle = UIStatusBarStyleBlackOpaque;
    
    _toolbar.tintColor = RGBCOLOR(111,63,35);
    
        2
  •  0
  •   Matt Hudson    14 年前

    将NavigationBartinColor代码添加到viewWillAppear而不是init。