Warrior
Warrior

Reputation: 39384

How to change the navigation bar style in Three20 TTThumbsviewcontroller in iphone?

I am using Three20 to create a thumbnail view. I want to change the navigation bar style to black from black translucent. If I give blacktranslucent it works fine, if I change it the thumb nail view is lowered like this image.

How can I change it?

Upvotes: 1

Views: 2374

Answers (1)

Nassif Bourguig
Nassif Bourguig

Reputation: 765

You can override the init method, and change whatever you want there. For instance :

// MyThumbsController inherits from TTThumbsViewController
@implementation MyThumbsController

...


    - (void) setCustomNavigationBar
    {
        // Navigation bar logo
        UIImage *barLogo = [UIImage imageNamed:@"bar-logo.png"];
        UIImageView *barLogoView = [[UIImageView alloc] initWithImage:barLogo];

        self.navigationItem.titleView = barLogoView;

        // Navigation bar color
        self.navigationBarTintColor = HEXCOLOR(0xb22929);

    }   

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
        if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {

            // Customization
            self.hidesBottomBarWhenPushed = NO;
            [self setCustomNavigationBar];

        }

        return self;
    }

Upvotes: 2

Related Questions