2

次の写真のようにしたい。

ここに画像の説明を入力

そのように使用するにはどうすればよいですか?

それは次の方法ですか?

- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section

ありがとう。

4

2 に答える 2

7
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    UIView *footer = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 540, 10)];
    footer.backgroundColor = [UIColor clearColor];

    UILabel *lbl = [[UILabel alloc]initWithFrame:footer.frame];
    lbl.backgroundColor = [UIColor clearColor];
    lbl.text = @"Your Text";
    lbl.textAlignment = NSTextAlignmentCenter;
    [footer addSubview:lbl];

    return footer;
}


- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 10.0;
}
于 2013-02-06T08:18:45.857 に答える