51 lines
1.2 KiB
Objective-C
51 lines
1.2 KiB
Objective-C
//
|
|
// TLSettingSectionFooterView.m
|
|
// TLChat
|
|
//
|
|
// Created by 李伯坤 on 2018/3/6.
|
|
// Copyright © 2018年 李伯坤. All rights reserved.
|
|
//
|
|
|
|
#import "TLSettingSectionFooterView.h"
|
|
|
|
#define FONT_SETTING_SECTION [UIFont systemFontOfSize:14.0f]
|
|
|
|
@interface TLSettingSectionFooterView ()
|
|
|
|
@property (nonatomic, strong) UILabel *titleLabel;
|
|
|
|
@end
|
|
|
|
@implementation TLSettingSectionFooterView
|
|
|
|
#pragma mark - # Protocol
|
|
+ (CGFloat)viewHeightByDataModel:(NSString *)dataModel
|
|
{
|
|
CGFloat textHeight = [dataModel tt_sizeWithFont:FONT_SETTING_SECTION constrainedToWidth:SCREEN_WIDTH - 30].height;
|
|
return textHeight + 15;
|
|
}
|
|
|
|
- (void)setViewDataModel:(id)dataModel
|
|
{
|
|
[self.titleLabel setText:dataModel];
|
|
}
|
|
|
|
#pragma mark - # View
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
{
|
|
if (self = [super initWithFrame:frame]) {
|
|
self.titleLabel = self.addLabel(1)
|
|
.font([UIFont systemFontOfSize:14]).textColor([UIColor grayColor])
|
|
.numberOfLines(0)
|
|
.masonry(^ (MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(15);
|
|
make.right.mas_equalTo(-15);
|
|
make.top.mas_equalTo(8);
|
|
})
|
|
.view;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
@end
|