2012年3月23日金曜日

UITableViewのヘッダー、フッターの上下マージン調整


UITableViewのデリゲートメソッドを実装し、sectionごとにヘッダー、フッターの高さを指定し、マージンを調整します。


- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    switch(section) {
        case 0: return @"書類選択";
        case 1: return @"検索条件";
        case 2: return @"ファイル表示順序";
    }
    return @"";
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    switch(section) {
        case 0: return 32.0;
        case 1: return 32.0;
        case 2: return 32.0;
    }
}

0 件のコメント: