2011-04-29 56 views
0
@property(nonatomic,retain) UIView *tableHeaderView; 

// accessory view for above row content. default is nil. not to be confused with section header 
@property(nonatomic,retain) UIView *tableFooterView; 

// accessory view below content. default is nil. not to be confused with section footer 
+1

步驟1:關閉Caps Lock鍵。 – 2011-04-29 09:09:11

+1

第2步:使用StackOverflow編輯器的格式化選項代碼(或只是縮進四個空格的代碼)。第3步:什麼是問題? – OregonGhost 2011-04-29 09:11:33

+0

第3步:提出一個問題。 – Eiko 2011-04-29 09:57:26

回答

1

我在頁腳中添加了標籤查看根據您的要求進行內部編碼 無需製作任何全局變量。

- (UIView *)tableView:(UITableView *)tbleView viewForFooterInSection:(NSInteger)section 
    { 
       UILabel *label; 
      label = [[[UILabel alloc] initWithFrame:CGRectMake(10, 0, 300, 30)]autorelease]; 
      [label setBackgroundColor:[UIColor clearColor]]; 
      label.textAlignment = UITextAlignmentCenter; 
      [label setTextColor:[UIColor whiteColor]]; 
      [label setFont:[UIFont boldSystemFontOfSize:15.0]]; 
      [label setText:NSLocalizedString(@"Instructions Personal Profile",@"Instructions Personal Profile")]; 


     UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 30)]autorelease]; 
      [view setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; 
     [view addSubview:label]; 
     return view; 


} 

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 
} 

用於設置頁腳和頁眉使用的高度: -

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 
{ 
} 
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 
{ 
}