From 5a06c9842a52ad3d45895f83499fa97b5bc8aa7c Mon Sep 17 00:00:00 2001 From: chenguilong <598604202@qq.com> Date: Fri, 30 Sep 2022 17:29:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=98=E5=8F=A0=E6=88=BF=E9=97=B4=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xplan-ios.xcodeproj/project.pbxproj | 6 + .../room_info_share@2x.png | Bin 734 -> 1238 bytes .../room_info_share@3x.png | Bin 996 -> 1950 bytes .../Room/View/RoomHeaderView/RoomHeaderView.m | 28 +-- .../SubViews/XPRoomInsideOperationCell.h | 19 ++ .../SubViews/XPRoomInsideOperationCell.m | 70 ++++++ .../View/RoomRecommend/XPRoomRecommendView.h | 2 + .../View/RoomRecommend/XPRoomRecommendView.m | 230 ++++++------------ 8 files changed, 176 insertions(+), 179 deletions(-) create mode 100644 xplan-ios/Main/Room/View/RoomRecommend/SubViews/XPRoomInsideOperationCell.h create mode 100644 xplan-ios/Main/Room/View/RoomRecommend/SubViews/XPRoomInsideOperationCell.m diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index e7478447..22acd12d 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -251,6 +251,7 @@ 9BAA5FF0277A23F4007453F3 /* XPPermissionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEF277A23F4007453F3 /* XPPermissionsViewController.m */; }; 9BAC92EE28E6989400147DD8 /* XPRoomActivityPlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAC92ED28E6989400147DD8 /* XPRoomActivityPlayView.m */; }; 9BAC92F228E6A05600147DD8 /* XPRoomActivityPlayModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAC92F128E6A05600147DD8 /* XPRoomActivityPlayModel.m */; }; + 9BAC92F528E6E63000147DD8 /* XPRoomInsideOperationCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAC92F428E6E63000147DD8 /* XPRoomInsideOperationCell.m */; }; 9BAD41AC28C6EB13005E47B3 /* XPInRoomRecordPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAD41AB28C6EB13005E47B3 /* XPInRoomRecordPresenter.m */; }; 9BB549592782E6A30090CD26 /* XPNobleCenterPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB549582782E6A30090CD26 /* XPNobleCenterPresenter.m */; }; 9BB5495C2782E79E0090CD26 /* NobleCenterModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB5495B2782E79E0090CD26 /* NobleCenterModel.m */; }; @@ -1673,6 +1674,8 @@ 9BAC92ED28E6989400147DD8 /* XPRoomActivityPlayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomActivityPlayView.m; sourceTree = ""; }; 9BAC92F028E6A05600147DD8 /* XPRoomActivityPlayModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomActivityPlayModel.h; sourceTree = ""; }; 9BAC92F128E6A05600147DD8 /* XPRoomActivityPlayModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomActivityPlayModel.m; sourceTree = ""; }; + 9BAC92F328E6E63000147DD8 /* XPRoomInsideOperationCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomInsideOperationCell.h; sourceTree = ""; }; + 9BAC92F428E6E63000147DD8 /* XPRoomInsideOperationCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomInsideOperationCell.m; sourceTree = ""; }; 9BAD41AA28C6EB13005E47B3 /* XPInRoomRecordPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPInRoomRecordPresenter.h; sourceTree = ""; }; 9BAD41AB28C6EB13005E47B3 /* XPInRoomRecordPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPInRoomRecordPresenter.m; sourceTree = ""; }; 9BAD41AD28C6ECBA005E47B3 /* XPInRoomRecordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPInRoomRecordProtocol.h; sourceTree = ""; }; @@ -4339,6 +4342,8 @@ 9B6E8572281AB9B20041A321 /* XPRoomInsideRecommendCell.m */, 9B6E8575281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.h */, 9B6E8576281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.m */, + 9BAC92F328E6E63000147DD8 /* XPRoomInsideOperationCell.h */, + 9BAC92F428E6E63000147DD8 /* XPRoomInsideOperationCell.m */, ); path = SubViews; sourceTree = ""; @@ -9042,6 +9047,7 @@ E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */, E81C1B1F27705F7A0020D1E4 /* XPArrangeMicViewController.m in Sources */, E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */, + 9BAC92F528E6E63000147DD8 /* XPRoomInsideOperationCell.m in Sources */, E86A16C22856D635004228B8 /* XPSessionFindNewGreetTableViewCell.m in Sources */, E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */, E86E79CD28A4E045006DAF48 /* MessageContentRiskAlertView.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Room/room_info_share.imageset/room_info_share@2x.png b/xplan-ios/Assets.xcassets/Room/room_info_share.imageset/room_info_share@2x.png index 558f6dda5fd26de0671c87d3fc2a8aaa144b7449..98ede266801d606a315904575192e4e9887f0991 100644 GIT binary patch delta 1108 zcmV-a1grbr1=a~KiBL{Q4GJ0x0000DNk~Le0001J0001J2m=5B04l;olK=n!nNUnr zMgRZ*0001yF_V8po{($+001&{QchDW00ku}A0iqQ4-F^r38F7;(KTTE+REuwLp?a* zn@IS(lpKXyPCMn@!={dA)wO+dt&zSb00003x=BPqRA}DSn(20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>G0R h>E(6nG4!Wjqkp3?yZSq6n;QTC002ovPDHLkV1g!Ikum@P diff --git a/xplan-ios/Main/Room/View/RoomHeaderView/RoomHeaderView.m b/xplan-ios/Main/Room/View/RoomHeaderView/RoomHeaderView.m index 7f237dc8..6d8d12d0 100644 --- a/xplan-ios/Main/Room/View/RoomHeaderView/RoomHeaderView.m +++ b/xplan-ios/Main/Room/View/RoomHeaderView/RoomHeaderView.m @@ -62,8 +62,6 @@ @property (nonatomic,strong) YYLabel *idLabel; ///收藏 @property (nonatomic,strong) UIButton *collectButton; -///分享 -@property (nonatomic,strong) UIButton *shareButton; ///设置 @property (nonatomic,strong) UIButton *settingButton; @property (nonatomic, weak) id hostDelegate; @@ -127,7 +125,6 @@ [self addSubview:self.backButton]; [self addSubview:self.nickStackView]; [self addSubview:self.collectButton]; - [self addSubview:self.shareButton]; [self addSubview:self.settingButton]; [self.nickStackView addArrangedSubview:self.titleStackView]; @@ -153,16 +150,10 @@ make.bottom.mas_equalTo(-11); make.width.height.mas_equalTo(22); }]; - - [self.shareButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.equalTo(self.settingButton.mas_left).offset(-8); - make.centerY.mas_equalTo(self.settingButton); - make.width.height.mas_equalTo(22); - }]; - + [self.collectButton mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(self.settingButton); - make.right.equalTo(self.shareButton.mas_left).offset(-8); + make.right.equalTo(self.settingButton.mas_left).offset(-8); make.width.height.mas_equalTo(22); }]; @@ -367,6 +358,11 @@ [self.hostDelegate exitRoom]; } +- (void)xPRoomRecommendViewShare { + [FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; + [self showSharePanel]; +} + - (void)xPRoomRecommendViewJumpToRoom:(NSString *)roomUid { [FFPopup dismissPopupForView:self.recommendRoomView animated:NO]; [self.hostDelegate exitRoom]; @@ -386,16 +382,6 @@ return _backButton; } -- (UIButton *)shareButton { - if(!_shareButton){ - _shareButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_shareButton setImage:[UIImage imageNamed:@"room_info_share"] forState:UIControlStateNormal]; - [_shareButton addTarget:self action:@selector(shareButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - [_shareButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8]; - } - return _shareButton; -} - - (UIButton *)settingButton { if (!_settingButton) { _settingButton = [UIButton buttonWithType:UIButtonTypeCustom]; diff --git a/xplan-ios/Main/Room/View/RoomRecommend/SubViews/XPRoomInsideOperationCell.h b/xplan-ios/Main/Room/View/RoomRecommend/SubViews/XPRoomInsideOperationCell.h new file mode 100644 index 00000000..3e45e78e --- /dev/null +++ b/xplan-ios/Main/Room/View/RoomRecommend/SubViews/XPRoomInsideOperationCell.h @@ -0,0 +1,19 @@ +// +// XPRoomInsideOperationCell.h +// xplan-ios +// +// Created by GreenLand on 2022/9/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomInsideOperationCell : UICollectionViewCell + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, copy) NSString *imageName; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/RoomRecommend/SubViews/XPRoomInsideOperationCell.m b/xplan-ios/Main/Room/View/RoomRecommend/SubViews/XPRoomInsideOperationCell.m new file mode 100644 index 00000000..ffcc4040 --- /dev/null +++ b/xplan-ios/Main/Room/View/RoomRecommend/SubViews/XPRoomInsideOperationCell.m @@ -0,0 +1,70 @@ +// +// XPRoomInsideOperationCell.m +// xplan-ios +// +// Created by GreenLand on 2022/9/30. +// + +#import "XPRoomInsideOperationCell.h" +///Third +#import + +@interface XPRoomInsideOperationCell() + +@property (nonatomic, strong) UIImageView *imageView; +@property (nonatomic, strong) UILabel *titleLabel; + +@end + +@implementation XPRoomInsideOperationCell + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self initView]; + [self initContraints]; + } + return self; +} + +- (void)initView { + [self addSubview:self.imageView]; + [self addSubview:self.titleLabel]; +} + +- (void)initContraints { + [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.centerX.mas_equalTo(self); + make.width.height.mas_equalTo(52); + }]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.imageView.mas_bottom).mas_offset(4); + make.centerX.mas_equalTo(self); + make.height.mas_equalTo(12); + }]; +} + +- (void)setTitle:(NSString *)title { + self.titleLabel.text = title; +} +- (void)setImageName:(NSString *)imageName { + self.imageView.image = [UIImage imageNamed:imageName]; +} + +- (UIImageView *)imageView { + if (!_imageView) { + _imageView = [[UIImageView alloc] init]; + } + return _imageView; +} + +- (UILabel *)titleLabel{ + if (!_titleLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [UIColor whiteColor]; + _titleLabel = label; + } + return _titleLabel; +} + +@end diff --git a/xplan-ios/Main/Room/View/RoomRecommend/XPRoomRecommendView.h b/xplan-ios/Main/Room/View/RoomRecommend/XPRoomRecommendView.h index 77d629cf..93d3cc67 100644 --- a/xplan-ios/Main/Room/View/RoomRecommend/XPRoomRecommendView.h +++ b/xplan-ios/Main/Room/View/RoomRecommend/XPRoomRecommendView.h @@ -17,6 +17,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)xPRoomRecommendViewMiniRoom; ///退出房间 - (void)xPRoomRecommendViewExitRoom; +///分享 +- (void)xPRoomRecommendViewShare; ///跳转到房间 - (void)xPRoomRecommendViewJumpToRoom:(NSString *)roomUid; diff --git a/xplan-ios/Main/Room/View/RoomRecommend/XPRoomRecommendView.m b/xplan-ios/Main/Room/View/RoomRecommend/XPRoomRecommendView.m index 6fa0a532..a3433c47 100644 --- a/xplan-ios/Main/Room/View/RoomRecommend/XPRoomRecommendView.m +++ b/xplan-ios/Main/Room/View/RoomRecommend/XPRoomRecommendView.m @@ -14,28 +14,17 @@ ///View #import "XPRoomInsideRecommendCell.h" #import "XPRoomInsideRecommendEmptyCell.h" +#import "XPRoomInsideOperationCell.h" -@interface XPRoomRecommendView () +@interface XPRoomRecommendView () ///模糊背景 @property (nonatomic, strong) UIToolbar *toolBar; @property (nonatomic, strong) UITableView *tableView; -@property (nonatomic, strong) UIStackView *reportStackView; -@property (nonatomic, strong) UIStackView *miniStackView; -@property (nonatomic, strong) UIStackView *exitStackView; -///举报 -@property (nonatomic,strong) UIButton *reportButton; -///最小化 -@property (nonatomic,strong) UIButton *miniButton; -///退出房间 -@property (nonatomic,strong) UIButton *exitButton; -///举报 -@property (nonatomic,strong) UILabel *reportLabel; -///最小化 -@property (nonatomic,strong) UILabel *miniLabel; -///退出房间 -@property (nonatomic,strong) UILabel *exitLabel; +@property (nonatomic, strong) UICollectionView *collectionView; +@property (nonatomic, strong) NSMutableArray *titleArray; +@property (nonatomic, strong) NSMutableArray *imageArray; ///为你推荐 @property (nonatomic, strong) UILabel *recommentLabel; @@ -54,15 +43,7 @@ #pragma mark - lifeCycle - (void)setUpUI { [self addSubview:self.toolBar]; - [self addSubview:self.reportStackView]; - [self addSubview:self.miniStackView]; - [self addSubview:self.exitStackView]; - [self.reportStackView addArrangedSubview:self.reportButton]; - [self.reportStackView addArrangedSubview:self.reportLabel]; - [self.miniStackView addArrangedSubview:self.miniButton]; - [self.miniStackView addArrangedSubview:self.miniLabel]; - [self.exitStackView addArrangedSubview:self.exitButton]; - [self.exitStackView addArrangedSubview:self.exitLabel]; + [self addSubview:self.collectionView]; [self addSubview:self.recommentLabel]; [self addSubview:self.tableView]; } @@ -77,30 +58,13 @@ [self.toolBar mas_makeConstraints:^(MASConstraintMaker *make) { make.top.left.right.bottom.mas_equalTo(self); }]; - [self.reportStackView mas_makeConstraints:^(MASConstraintMaker *make) { + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(0); make.top.mas_equalTo(kStatusBarHeight + 8); - make.left.mas_equalTo(15); - }]; - [self.miniStackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kStatusBarHeight + 8); - make.left.mas_equalTo(self.reportStackView.mas_right).mas_offset(30); - }]; - [self.exitStackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(kStatusBarHeight + 8); - make.left.mas_equalTo(self.miniStackView.mas_right).mas_offset(30); - }]; - - [self.reportButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(54); - }]; - [self.miniButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(54); - }]; - [self.exitButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(54); + make.height.mas_equalTo(82*2); }]; [self.recommentLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.miniStackView.mas_bottom).mas_offset(16); + make.top.mas_equalTo(self.collectionView.mas_bottom).mas_offset(16); make.left.mas_equalTo(11); }]; [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -108,6 +72,37 @@ make.top.mas_equalTo(self.recommentLabel.mas_bottom); }]; } +#pragma mark - UICollectionViewDataSource +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.titleArray.count; +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + XPRoomInsideOperationCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPRoomInsideOperationCell class]) forIndexPath:indexPath]; + cell.title = self.titleArray[indexPath.row]; + cell.imageName = self.imageArray[indexPath.row]; + return cell; +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + if (indexPath.row == 0) {//最小化房间 + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewMiniRoom)]) { + [self.delegate xPRoomRecommendViewMiniRoom]; + } + } else if (indexPath.row == 1) {//分享房间 + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewShare)]) { + [self.delegate xPRoomRecommendViewShare]; + } + } else if (indexPath.row == 2) {//退出房间 + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewExitRoom)]) { + [self.delegate xPRoomRecommendViewExitRoom]; + } + } else {//举报房间 + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewReport)]) { + [self.delegate xPRoomRecommendViewReport]; + } + } +} #pragma mark - UITableViewDelegate - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { @@ -142,25 +137,6 @@ return self.roomList.count > 0 ? 84 : KScreenHeight - kStatusBarHeight -8 - 120; } -#pragma mark - atcion -- (void)reportButtonAction:(UIButton *)sender { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewReport)]) { - [self.delegate xPRoomRecommendViewReport]; - } -} - -- (void)miniButtonAction:(UIButton *)sender { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewMiniRoom)]) { - [self.delegate xPRoomRecommendViewMiniRoom]; - } -} - -- (void)exitButtonAction:(UIButton *)sender{ - if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRecommendViewExitRoom)]) { - [self.delegate xPRoomRecommendViewExitRoom]; - } -} - #pragma mark - getter - (UIToolbar *)toolBar { if (!_toolBar) { @@ -171,99 +147,6 @@ return _toolBar; } -- (UIButton *)miniButton { - if(!_miniButton){ - _miniButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_miniButton setImage:[UIImage imageNamed:@"room_info_mini"] forState:UIControlStateNormal]; - [_miniButton addTarget:self action:@selector(miniButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - [_miniButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _miniButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; - } - return _miniButton; -} - -- (UIButton *)exitButton { - if (!_exitButton) { - _exitButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_exitButton setImage:[UIImage imageNamed:@"room_info_exit"] forState:UIControlStateNormal]; - [_exitButton addTarget:self action:@selector(exitButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _exitButton; -} - -- (UIButton *)reportButton { - if (!_reportButton) { - _reportButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_reportButton setImage:[UIImage imageNamed:@"room_info_report"] forState:UIControlStateNormal]; - [_reportButton addTarget:self action:@selector(reportButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _reportButton; -} - -- (UIStackView *)reportStackView { - if (!_reportStackView) { - _reportStackView = [[UIStackView alloc] init]; - _reportStackView.axis = UILayoutConstraintAxisVertical; - _reportStackView.distribution = UIStackViewDistributionFill; - _reportStackView.alignment = UIStackViewAlignmentCenter; - _reportStackView.spacing = 17; - } - return _reportStackView; -} -- (UIStackView *)miniStackView { - if (!_miniStackView) { - _miniStackView = [[UIStackView alloc] init]; - _miniStackView.axis = UILayoutConstraintAxisVertical; - _miniStackView.distribution = UIStackViewDistributionFill; - _miniStackView.alignment = UIStackViewAlignmentCenter; - _miniStackView.spacing = 17; - } - return _miniStackView; -} -- (UIStackView *)exitStackView { - if (!_exitStackView) { - _exitStackView = [[UIStackView alloc] init]; - _exitStackView.axis = UILayoutConstraintAxisVertical; - _exitStackView.distribution = UIStackViewDistributionFill; - _exitStackView.alignment = UIStackViewAlignmentCenter; - _exitStackView.spacing = 17; - } - return _exitStackView; -} - -- (UILabel *)reportLabel { - if (!_reportLabel) { - _reportLabel = [[UILabel alloc] init]; - _reportLabel.text = @"举报房间"; - _reportLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; - _reportLabel.textAlignment = NSTextAlignmentCenter; - _reportLabel.textColor = [UIColor whiteColor]; - } - return _reportLabel; -} - -- (UILabel *)miniLabel { - if (!_miniLabel) { - _miniLabel = [[UILabel alloc] init]; - _miniLabel.text = @"收起房间"; - _miniLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; - _miniLabel.textAlignment = NSTextAlignmentCenter; - _miniLabel.textColor = [UIColor whiteColor]; - } - return _miniLabel; -} - -- (UILabel *)exitLabel { - if (!_exitLabel) { - _exitLabel = [[UILabel alloc] init]; - _exitLabel.text = @"退出房间"; - _exitLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; - _exitLabel.textAlignment = NSTextAlignmentCenter; - _exitLabel.textColor = [UIColor whiteColor]; - } - return _exitLabel; -} - - (UILabel *)recommentLabel { if (!_recommentLabel) { _recommentLabel = [[UILabel alloc] init]; @@ -288,4 +171,35 @@ return _tableView; } +- (UICollectionView *)collectionView { + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.scrollDirection = UICollectionViewScrollDirectionVertical; + layout.minimumLineSpacing = 14; + layout.minimumInteritemSpacing = (250 - 3 * 52) / 4; + layout.itemSize = CGSizeMake(52, 68); + layout.sectionInset = UIEdgeInsetsMake(0, (250 - 3 * 52) / 4, 0, (250 - 3 * 52) / 4); + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + [_collectionView registerClass:[XPRoomInsideOperationCell class] forCellWithReuseIdentifier:NSStringFromClass([XPRoomInsideOperationCell class])]; + _collectionView.delegate = self; + _collectionView.dataSource = self; + _collectionView.backgroundColor = [UIColor clearColor]; + } + return _collectionView; +} + +- (NSMutableArray *)titleArray { + if (!_titleArray) { + _titleArray = [NSMutableArray arrayWithObjects:@"收起房间", @"分享房间", @"退出房间", @"举报房间", nil]; + } + return _titleArray; +} + +- (NSMutableArray *)imageArray { + if (!_imageArray) { + _imageArray = [NSMutableArray arrayWithObjects:@"room_info_mini", @"room_info_share", @"room_info_exit", @"room_info_report", nil]; + } + return _imageArray; +} + @end