12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- //
- // ShowBtn.m
- // smartRhino
- //
- // Created by niuzhen on 2020/2/26.
- // Copyright © 2020 tederen. All rights reserved.
- //
- #import "ShowBtn.h"
- @implementation ShowBtn
- - (instancetype)init
- {
- self = [super init];
- if (self) {
- }
- return self;
- }
- - (void)setLabelTitle:(NSString *)title
- {
- self.title = [NSString stringWithFormat:@"%@ ",title];
- NSMutableAttributedString * attStr = [[NSMutableAttributedString alloc] initWithString:self.title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17],NSForegroundColorAttributeName:UIColorHex(0x000000)}];
- NSTextAttachment *attach = [[NSTextAttachment alloc] init];
- attach.image = [UIImage imageNamed:@"chatmsg_notice_showAll_icon"];
- NSAttributedString *collegeStr = [NSAttributedString attributedStringWithAttachment:attach];
- [attStr appendAttributedString:collegeStr];
- [attStr appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]];
- [self setAttributedTitle:attStr forState:UIControlStateNormal];
- }
- - (void)show
- {
- NSMutableAttributedString * attStr = [[NSMutableAttributedString alloc] initWithString:self.title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17],NSForegroundColorAttributeName:UIColorHex(0x000000)}];
- NSTextAttachment *attach = [[NSTextAttachment alloc] init];
- attach.image = [UIImage imageNamed:@"chatmsg_notice_hideAll_icon"];
- NSAttributedString *collegeStr = [NSAttributedString attributedStringWithAttachment:attach];
- [attStr appendAttributedString:collegeStr];
- [self setAttributedTitle:attStr forState:UIControlStateNormal];
- }
- - (void)dismiss
- {
- NSMutableAttributedString * attStr = [[NSMutableAttributedString alloc] initWithString:self.title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17],NSForegroundColorAttributeName:UIColorHex(0x000000)}];
- NSTextAttachment *attach = [[NSTextAttachment alloc] init];
- attach.image = [UIImage imageNamed:@"chatmsg_notice_showAll_icon"];
- NSAttributedString *collegeStr = [NSAttributedString attributedStringWithAttachment:attach];
- [attStr appendAttributedString:collegeStr];
- [self setAttributedTitle:attStr forState:UIControlStateNormal];
- }
- - (void)setcomTitle:(NSString *)title
- {
- self.title = [NSString stringWithFormat:@"%@ ",title];
- NSMutableAttributedString * attStr = [[NSMutableAttributedString alloc] initWithString:self.title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:UIColorHex(0x666666)}];
- NSTextAttachment *attach = [[NSTextAttachment alloc] init];
- attach.image = [UIImage imageNamed:@"chatmsg_notice_showAll_icon"];
- NSAttributedString *collegeStr = [NSAttributedString attributedStringWithAttachment:attach];
- [attStr appendAttributedString:collegeStr];
- [attStr appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]];
- [self setAttributedTitle:attStr forState:UIControlStateNormal];
- }
- - (void)showCom
- {
- NSMutableAttributedString * attStr = [[NSMutableAttributedString alloc] initWithString:self.title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:UIColorHex(0x666666)}];
- NSTextAttachment *attach = [[NSTextAttachment alloc] init];
- attach.image = [UIImage imageNamed:@"chatmsg_notice_hideAll_icon"];
- NSAttributedString *collegeStr = [NSAttributedString attributedStringWithAttachment:attach];
- [attStr appendAttributedString:collegeStr];
- [self setAttributedTitle:attStr forState:UIControlStateNormal];
- }
- - (void)dismissCom
- {
- NSMutableAttributedString * attStr = [[NSMutableAttributedString alloc] initWithString:self.title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14],NSForegroundColorAttributeName:UIColorHex(0x666666)}];
- NSTextAttachment *attach = [[NSTextAttachment alloc] init];
- attach.image = [UIImage imageNamed:@"chatmsg_notice_showAll_icon"];
- NSAttributedString *collegeStr = [NSAttributedString attributedStringWithAttachment:attach];
- [attStr appendAttributedString:collegeStr];
- [self setAttributedTitle:attStr forState:UIControlStateNormal];
- }
- @end
|