Plain style tableView禁止header和footer浮動的方法

Plain style tableView禁止header和footer浮動的方法

繼承UITableView類,在子類覆寫方法- (BOOL)allowsHeaderViewsToFloat- (BOOL)allowsHeaderViewsToFloat,代碼如下:

@implementation DQNoHeaderFloatingTableView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

- (BOOL)allowsHeaderViewsToFloat {
    return NO;
}
- (BOOL)allowsFooterViewsToFloat {
    return NO;
}
@end
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章