title: text in header & footer of table section iPhone
body: <p>I've a question about printing text in header and footer of table view section. I want to show some text in footer of each row, but I'm having problem doing so. When I start next section it start drawing from below of first one. To Get the idea what exactly I need, go to Settings->General->Network</p>
  
  <p>In this screen, we've multiple sections and after first two sections we've footer information.</p>
  
  <p>Please check this on iPhone 3G. (I'm not sure if this screen is avaiable on other variants of iPhone.)</p>
  
  <p>Let me know if you need any clarification in the description.</p>
  
  <hr>
  
  <p>Here are two functions implementation but it does not display as desired</p>
  
  <pre><code>-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  {
        if (section == 1)
        {
          CGRect rect = CGRectMake(10.0f,40.0f,300.0f,250.0f);
  
          UILabel* label  = [[[UILabel alloc] initWithFrame:rect] autorelease];
          label.backgroundColor   = [UIColor clearColor];
              label.text      = NSLocalizedString(@"MessageHeader","");;
              label.baselineAdjustment= UIBaselineAdjustmentAlignCenters;
              label.lineBreakMode =  UILineBreakModeWordWrap;
              label.textAlignment = UITextAlignmentCenter;
              label.shadowColor   = [UIColor whiteColor];
              label.shadowOffset  = CGSizeMake(0.0, 1.0);
              label.font      = [UIFont systemFontOfSize:14];
              label.textColor     = [UIColor darkGrayColor];
              label.numberOfLines = 0;
  
  
              UIView *view = [[[UIView alloc] initWithFrame:rect] autorelease];
  
              [view addSubview:label];
  
              return view;
          }
      }   
      return nil;     
  }
  
  
  - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 
  {
  
     if (section == 1) 
     {
                            CGRect rect       = CGRectMake(10.0f,80.0f,300.0f,250.0f); 
  
                           UILabel* label = [[[UILabel alloc] initWithFrame:rect] autorelease];
                        label.backgroundColor = [UIColor clearColor];
                        label.text        = NSLocalizedString(@"MessageFooter","");
                        label.baselineAdjustment= UIBaselineAdjustmentAlignCenters;
              label.lineBreakMode     =  UILineBreakModeWordWrap;
              label.textAlignment     = UITextAlignmentCenter;
              label.shadowColor       = [UIColor whiteColor];
              label.shadowOffset      = CGSizeMake(0.0, 1.0);
              label.font          = [UIFont systemFontOfSize:14];
              label.textColor         = [UIColor darkGrayColor];
              label.numberOfLines = 0;
              UIView *view = [[[UIView alloc] initWithFrame:rect] autorelease];
              [view addSubview:label];
  
              return view;
          }
      }
      return nil;
  }
  </code></pre>
  
  <p>What's wrong here? Why Header &amp; footer text goes all the way to bottom of all the sections.</p>