From 7b02207537d35bfa1714bf8beafc921f717d100a Mon Sep 17 00:00:00 2001 From: 单军华 Date: Wed, 11 Jul 2018 10:47:42 +0800 Subject: [PATCH] 首次上传 --- screendisplay/Pods/HMEmoticon/表情键盘/Emoticon/HMEmoticonButton.m | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 52 insertions(+), 0 deletions(-) diff --git "a/screendisplay/Pods/HMEmoticon/\350\241\250\346\203\205\351\224\256\347\233\230/Emoticon/HMEmoticonButton.m" "b/screendisplay/Pods/HMEmoticon/\350\241\250\346\203\205\351\224\256\347\233\230/Emoticon/HMEmoticonButton.m" new file mode 100755 index 0000000..b3680bf --- /dev/null +++ "b/screendisplay/Pods/HMEmoticon/\350\241\250\346\203\205\351\224\256\347\233\230/Emoticon/HMEmoticonButton.m" @@ -0,0 +1,52 @@ +// +// HMEmoticonButton.m +// ������������ +// +// Created by ������ on 16/3/5. +// Copyright �� 2016��� itcast. All rights reserved. +// + +#import "HMEmoticonButton.h" +#import "UIImage+HMEmoticon.h" +#import "HMEmoticon.h" + +@implementation HMEmoticonButton + +#pragma mark - ������ +- (void)setDeleteButton:(BOOL)deleteButton { + _deleteButton = deleteButton; + + [self setImage:[UIImage hm_imageNamed:@"compose_emotion_delete"] + forState:UIControlStateNormal]; + [self setImage:[UIImage hm_imageNamed:@"compose_emotion_delete_highlighted"] + forState:UIControlStateHighlighted]; +} + +- (void)setEmoticon:(HMEmoticon *)emoticon { + _emoticon = emoticon; + + self.hidden = (emoticon == nil); + + [self setImage:[UIImage hm_imageNamed:emoticon.imagePath] forState:UIControlStateNormal]; + [self setTitle:emoticon.emoji forState:UIControlStateNormal]; +} + +#pragma mark - ������������ ++ (instancetype)emoticonButtonWithFrame:(CGRect)frame tag:(NSInteger)tag { + HMEmoticonButton *button = [[self alloc] initWithFrame:frame]; + + button.tag = tag; + + return button; +} + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + self.titleLabel.font = [UIFont systemFontOfSize:32]; + self.titleEdgeInsets = UIEdgeInsetsMake(0, 4, 0, 0); + } + return self; +} + +@end -- Gitblit v1.8.0