tags:

views:

250

answers:

2

When I use the indexpath.row = 0 ,it is working fine and showing below the header

But when I use the indexpath.row =1 , the row 1 will move inside the header section of the table view .

Please help me , i want the first row should be hidden at lauch .

[alltweettableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO];

A: 

please help me ...

i need it

crystal
A: 

I am guessing that you are using the default table headers with some transparency / translucency (similar to the contacts app) and so the bottom of the first row shows through there.

Have a look at the documentation for UITableViewDelegate method tableView:viewForHeaderInSection, and then you can implement that method in your tableView's delegate. Send it a view with a non-translucent (or transparent) background, and it should prevent the top row from showing through.

To get started, I'd have it return a custom-sized UILabel directly with a solid white background and make sure it works as it should (because I haven't tested this:)


// you'd probably need to fill in the frame sizes yourself
// so try something other than CGRectZero at first. 

// for example (10,2,320,30) to start, then go from there
#define X 10
#define Y 2
#define WIDTH 320
#define HEIGHT 30

-(UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section
{
  UILabel *sectionHeader = [[UILabel alloc] initWithFrame:CGRectMake(X,Y,WIDTH,HEIGHT)];
  sectionHeader.text = [NSString stringWithFormat:@"Section %d",section];
  sectionHeader.background = [UIColor whiteColor];
  return [sectionHeader autorelease];
}


Assuming that works and looks like progress, you'll probably want to compose a custom view return that as a next step.

codehearted