定义表视图的表头表尾并重用
1、定义表头子类
#pragma mark - HeaderView
#define HeaderIdentifier @"Header"
@interface PCOrderListHeaderView : UITableViewHeaderFooterView
/** 订单创建时间 */
@property (nonatomic, strong) UILabel *timeLabel;
/** 订单状态 */
@property (nonatomic, strong) UILabel *statusLabel;
@end
@implementation PCOrderListHeaderView
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithReuseIdentifier:reuseIdentifier];
if (self) {
[self configureView];
}
return self;
}
- (void)configureView
{
self.contentView.backgroundColor = [UIColor whiteColor