Edit: It works fine, But still when the table get Loads Some gap remains between table top and table header abt 30 pxcls(or 1 row) ..?
Please help....
I am
If I understand your question correctly, it sounds like you just need the table not to bounce. If that's the case, all you need to do is set yourTable.bounces = NO;
in your viewDidLoad function. Either that or uncheck the "Bounces" option in the NIB if you used one to layout your table.
Here's how to fix the problem you mentioned in your edit... You need to replace the following references to tableView.headerView with references to a new view that's not being passed into the delegate method.
UIView *headerView = [[[UIView alloc] initWithFrame:rectArea] autorelease];
//...
[headerView setBackgroundColor:[UIColor grayColor]];
//...
[headerView addSubview:lbl];
//...
return headerView;
I tried it and it did the trick for me. Hope that helps.