From 7b02207537d35bfa1714bf8beafc921f717d100a Mon Sep 17 00:00:00 2001 From: 单军华 Date: Wed, 11 Jul 2018 10:47:42 +0800 Subject: [PATCH] 首次上传 --- screendisplay/Pods/EaseUI/EaseUI/EMUIKit/Views/conversation/MessageCell/EaseMessageTimeCell.m | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 deletions(-) diff --git a/screendisplay/Pods/EaseUI/EaseUI/EMUIKit/Views/conversation/MessageCell/EaseMessageTimeCell.m b/screendisplay/Pods/EaseUI/EaseUI/EMUIKit/Views/conversation/MessageCell/EaseMessageTimeCell.m new file mode 100755 index 0000000..0f1a9e3 --- /dev/null +++ b/screendisplay/Pods/EaseUI/EaseUI/EMUIKit/Views/conversation/MessageCell/EaseMessageTimeCell.m @@ -0,0 +1,98 @@ +/************************************************************ + * * Hyphenate CONFIDENTIAL + * __________________ + * Copyright (C) 2016 Hyphenate Inc. All rights reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Hyphenate Inc. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Hyphenate Inc. + */ + +#import "EaseMessageTimeCell.h" + +CGFloat const EaseMessageTimeCellPadding = 5; + +@interface EaseMessageTimeCell() + +@property (strong, nonatomic) UILabel *titleLabel; + +@end + +@implementation EaseMessageTimeCell + ++ (void)initialize +{ + // UIAppearance Proxy Defaults + EaseMessageTimeCell *cell = [self appearance]; + cell.titleLabelColor = [UIColor grayColor]; + cell.titleLabelFont = [UIFont systemFontOfSize:12]; +} + +- (instancetype)initWithStyle:(UITableViewCellStyle)style + reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + self.backgroundColor = [UIColor clearColor]; + [self _setupSubview]; + } + + return self; +} + +#pragma mark - setup subviews + +- (void)_setupSubview +{ + _titleLabel = [[UILabel alloc] init]; + _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; + _titleLabel.textAlignment = NSTextAlignmentCenter; + _titleLabel.backgroundColor = [UIColor clearColor]; + _titleLabel.textColor = _titleLabelColor; + _titleLabel.font = _titleLabelFont; + [self.contentView addSubview:_titleLabel]; + + [self _setupTitleLabelConstraints]; +} + +#pragma mark - Setup Constraints + +- (void)_setupTitleLabelConstraints +{ + [self addConstraint:[NSLayoutConstraint constraintWithItem:self.titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:EaseMessageTimeCellPadding]]; + [self addConstraint:[NSLayoutConstraint constraintWithItem:self.titleLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-EaseMessageTimeCellPadding]]; + [self addConstraint:[NSLayoutConstraint constraintWithItem:self.titleLabel attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:0]]; + [self addConstraint:[NSLayoutConstraint constraintWithItem:self.titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-EaseMessageTimeCellPadding]]; + [self addConstraint:[NSLayoutConstraint constraintWithItem:self.titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:EaseMessageTimeCellPadding]]; +} + +#pragma mark - setter + +- (void)setTitle:(NSString *)title +{ + _title = title; + _titleLabel.text = _title; +} + +- (void)setTitleLabelFont:(UIFont *)titleLabelFont +{ + _titleLabelFont = titleLabelFont; + _titleLabel.font = _titleLabelFont; +} + +- (void)setTitleLabelColor:(UIColor *)titleLabelColor +{ + _titleLabelColor = titleLabelColor; + _titleLabel.textColor = _titleLabelColor; +} + +#pragma mark - public + ++ (NSString *)cellIdentifier +{ + return @"MessageTimeCell"; +} + +@end -- Gitblit v1.8.0