views:

18

answers:

1

hi,

my app uses a tab bar with 2 navigation based views in which I am adding a custom view (a title bar) between the nav bar and the table view .

- (void)viewDidLoad {
    [super viewDidLoad];

 // load title bar controller
 TitleBarViewController *tbar = [[TitleBarViewController alloc] init];
 [tbar setTitleImage:[UIImage imageNamed:@"v2-une.png"]];
 [self setTitleBar:tbar];
 [tbar release];



    // show title bar
     [self.navigationController.view addSubview:self.titleBar.view];

....

When the application is launched with a default selected nav view, I use (void)viewDidAppearBOOL)animated to set the table view to a lower Y value so that the title bar is visible.

Where Y = 20 : 20 is the height of my title bar.

self.tableView.frame = CGRectMake(0, 20, 320, 347);

The problem is that when I select a row and push a detail view and hide the bottom bar to display a toolbar, things are messed up. my title bar's height increases and becomes > 20 which I can't explain why.

Now when I go back to the main table view, its Y is decreased by 20 and sticked to the nav bar. My title ben then appears above the first cell of the table view.

If hit the 2 tab and then go back to the 1st tab, everything is re arranged like expected.

here are some pics to illustrate all that : link text

can anyone help me figure out why is this happening please ? may be I am putting my positioning code in the wrong event ?

A: 

Is is possible that the background to everything is black and the tableview is moving down exposing the background, as opposed to the black titleBar actually increasing in size? This makes some sense given that the problem goes away when the tableView moves back up.

fogelbaby
Thank you for taking the time to answer.That is actually happening. It is pushed down for a weird reason, although I'm setting a correct frame to it in order to fill the entire view. But anyway I ended up using a container view for the title bar and the table view, and created the table view manually without using UITableViewController.I had more control over it that way.
HBR