TTThumbsViewController + navigationController issue
Asked Answered
T

2

6

I am only using Three20 for a gallery in my app.

When I push my .. : TTThumbsViewController from another view, the navigation bar is not the color I want it to be (as per the rest of my app). I have set up a TTDefaultStyleSheet as per this stackoverflow QA. Is there something special I have to do as I am only using the TTThumbsViewController?

The thumbs view is also created with extra space at the top, as though it is leaving room for a navigation controller, without knowing that one is already there. How can I tell the TTThumbsViewController to use the existing uinavigationcontroller? Or behave as though it is?

MYThumbsViewController *mYThumbsViewController = [MYThumbsViewController alloc];
[self.navigationController pushViewController:mYThumbsViewController animated:YES];

The problem depicted graphically:

alt text http://www.imgplace.com/img594/1309/39testapp.png

Thanks!

Tableau answered 10/4, 2010 at 16:33 Comment(0)
C
3

I found the solution.

In my ThumbsViewController I have this:

- (void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];
    UINavigationController* navController = self.navigationController;

    navController.navigationBar.barStyle = UIBarStyleBlackTranslucent;

    [self setWantsFullScreenLayout:YES];
}

The thumbs are now in the correct position.

Carbonyl answered 23/4, 2010 at 23:37 Comment(1)
> I want to change the bar style ,if i gave any other style other than UIBarStyleBlackTranslucent then i get the above problem.Thanks.Anonym
M
9

If you do not want to use a transparent navigation bar, this issue can be corrected by implementing the following method:

- (void) updateTableLayout {

self.tableView.contentInset = UIEdgeInsetsMake(5, 0, 0, 0);
self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(TTBarsHeight(), 0, 0, 0);}
Manufacture answered 5/6, 2010 at 0:51 Comment(2)
This solution, not Misa's (sorry Misa), totally worked for me. Thanks...randomly generated username :)Change
Was having the same problem, and I found that I needed both suggestions to get it to work. Thanks to everyone! :)Tautonym
C
3

I found the solution.

In my ThumbsViewController I have this:

- (void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];
    UINavigationController* navController = self.navigationController;

    navController.navigationBar.barStyle = UIBarStyleBlackTranslucent;

    [self setWantsFullScreenLayout:YES];
}

The thumbs are now in the correct position.

Carbonyl answered 23/4, 2010 at 23:37 Comment(1)
> I want to change the bar style ,if i gave any other style other than UIBarStyleBlackTranslucent then i get the above problem.Thanks.Anonym

© 2022 - 2024 — McMap. All rights reserved.