// // JxnoticeScrollView.m // shiku_im // // Created by 123 on 2020/6/1. // Copyright © 2020 Reese. All rights reserved. // #import "JxnoticeScrollView.h" #import "JXLabelObject.h" #import "JLSelectModel.h" @interface JxnoticeScrollView () @property (nonatomic,strong) UIView *noticeView ; @end @implementation JxnoticeScrollView -(instancetype)initWithFrame:(CGRect)frame{ if (self=[super initWithFrame:frame]) { _noticeView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, JX_SCREEN_WIDTH, 40)]; _noticeView.backgroundColor = [UIColor whiteColor]; _noticeView.userInteractionEnabled=YES; _noticeView.hidden = NO; [self addSubview:_noticeView]; _noticeLabel = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 80, 40)]; _noticeLabel.titleLabel.font=[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; [_noticeLabel setTitle:@"特别关心" forState:UIControlStateNormal]; [_noticeLabel setTitleColor:HEXCOLOR(0x323232) forState:UIControlStateNormal]; [_noticeView addSubview:_noticeLabel]; [_noticeLabel addTarget:self action:@selector(noticeBtnClick:) forControlEvents:UIControlEventTouchUpInside]; _noticeTitleScrolView = [[UIScrollView alloc] initWithFrame:CGRectMake(80, 0, JX_SCREEN_WIDTH-95, 40)]; _noticeTitleScrolView.userInteractionEnabled=YES; [self addSubview:_noticeTitleScrolView]; [g_notify addObserver:self selector:@selector(act_UserRoomAttention:) name:@"act_UserRoomAttention222" object:nil]; } return self; } -(CGSize)titleBtnWight:(NSString *)titBtnW and:(UIButton *)titBtn { CGSize titleSize = [titBtnW boundingRectWithSize:CGSizeMake(MAXFLOAT, 40) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:titBtn.titleLabel.font} context:nil].size; return titleSize; } - (void)act_UserRoomAttention:(NSNotification *)note{ NSDictionary *dict=note.userInfo; NSArray *tempArr=dict[@"user"]; _dataArr=[tempArr mutableCopy]; CGFloat titBtnX =10; for(int i =0; i