編集:それはうまく動作しますが、まだテーブルがロードを取得するテーブルトップとテーブルヘッダabt 30 pxcls(または1行)の間にいくつかのギャップが残っています..?テーブルトップとテーブルヘッダーの間には、テーブルがロードされて最後のローまでスクロールされたときにだけギャップが残っていますか?
助けてください....
私はそれがうまく動作しています。すべての表の行がスクロールしており、表のヘッダーが固定されています。 しかし、テーブルの最後までスクロールすると、修正のプロパティが失われます。私は境界線のスクロールを意味します。私はそれを絶対に凍結したい。境界条件では、テーブルの上部位置が緩み、約20 pxclsスライドします。
//Header Format starting
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 20.0;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
if (tableView.tableHeaderView) { // header was already created... go away
return tableView.tableHeaderView;
}
CGFloat width = 300.0f;
CGRect rectArea = CGRectMake(10.0f, 5.0f, width, 25.0);
tableView.tableHeaderView = [[[UIView alloc] initWithFrame:rectArea] autorelease];
//UIColor *orange = [UIColor colorWithRed:(255.0f/255.0f) green:(228.0f/255.0f) blue:0.0f alpha:1.0f];
[tableView.tableHeaderView setBackgroundColor:[UIColor grayColor]];
rectArea = CGRectMake(02.0f, 1.0f, width, 20.0);
UILabel *lbl = [[UILabel alloc] initWithFrame:rectArea];
lbl.text = NSLocalizedString(@"Bill Total", @"");
lbl.textAlignment = UITextAlignmentLeft;
//lbl.font = [UIFont systemFontOfSize:13.0f];
lbl.font = [UIFont fontWithName:@"Courier New" size:14];
lbl.font=[UIFont italicSystemFontOfSize:14];
lbl.textColor = [UIColor blackColor];
lbl.backgroundColor = [UIColor clearColor];
lbl.numberOfLines = 2.0f;
lbl.lineBreakMode = UILineBreakModeWordWrap;
//[lbl sizeToFit];
[tableView.tableHeaderView addSubview:lbl];
[lbl release];
// self.table.tableHeaderView.layer.cornerRadius = 6.0f;
return table.tableHeaderView;
}