修改首页开黑畅聊热门房间显示异常的问题
This commit is contained in:
@@ -86,40 +86,40 @@
|
||||
|
||||
[self.roomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.backView).offset(34);
|
||||
make.top.mas_equalTo(self.backView).offset(13);
|
||||
make.top.mas_equalTo(self.backView).offset(10);
|
||||
make.right.mas_lessThanOrEqualTo(self.avatarImageView);
|
||||
}];
|
||||
|
||||
[self.roomTagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(38, 16));
|
||||
make.left.mas_equalTo(self.roomTitleLabel);
|
||||
make.top.mas_equalTo(self.roomTitleLabel.mas_bottom).offset(3);
|
||||
make.top.mas_equalTo(self.roomTitleLabel.mas_bottom).offset(8 );
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.roomTagImageView.mas_right).offset(8);
|
||||
make.height.mas_equalTo(16);
|
||||
make.height.mas_equalTo(20);
|
||||
make.centerY.mas_equalTo(self.roomTagImageView);
|
||||
}];
|
||||
|
||||
[self.firstImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(16);
|
||||
make.width.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.secondImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(16);
|
||||
make.width.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.thirdImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(16);
|
||||
make.width.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.fourthImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(16);
|
||||
make.width.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.fifImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(16);
|
||||
make.width.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -217,7 +217,7 @@
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_firstImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_firstImageView.layer.masksToBounds = YES;
|
||||
_firstImageView.layer.cornerRadius = 8;
|
||||
_firstImageView.layer.cornerRadius = 10;
|
||||
_firstImageView.layer.borderWidth = 1;
|
||||
_firstImageView.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
}
|
||||
@@ -231,7 +231,7 @@
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_secondImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_secondImageView.layer.masksToBounds = YES;
|
||||
_secondImageView.layer.cornerRadius = 8;
|
||||
_secondImageView.layer.cornerRadius = 10;
|
||||
_secondImageView.layer.borderWidth = 1;
|
||||
_secondImageView.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
}
|
||||
@@ -245,7 +245,7 @@
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_thirdImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_thirdImageView.layer.masksToBounds = YES;
|
||||
_thirdImageView.layer.cornerRadius = 8;
|
||||
_thirdImageView.layer.cornerRadius = 10;
|
||||
_thirdImageView.layer.borderWidth = 1;
|
||||
_thirdImageView.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
}
|
||||
@@ -259,7 +259,7 @@
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_fourthImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_fourthImageView.layer.masksToBounds = YES;
|
||||
_fourthImageView.layer.cornerRadius = 8;
|
||||
_fourthImageView.layer.cornerRadius = 10;
|
||||
_fourthImageView.layer.borderWidth = 1;
|
||||
_fourthImageView.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
}
|
||||
@@ -273,7 +273,7 @@
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_fifImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_fifImageView.layer.masksToBounds = YES;
|
||||
_fifImageView.layer.cornerRadius = 8;
|
||||
_fifImageView.layer.cornerRadius = 10;
|
||||
_fifImageView.layer.borderWidth = 1;
|
||||
_fifImageView.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
}
|
||||
|
@@ -62,7 +62,7 @@
|
||||
}];
|
||||
|
||||
[self.secondView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(108 * kScreenScale, 108 * kScreenScale));
|
||||
make.size.mas_equalTo(CGSizeMake(108 * kScreenScale, 110 * kScreenScale));
|
||||
make.left.mas_equalTo(self.firstView.mas_right).offset(spaceWidth);
|
||||
make.top.mas_equalTo(self.contentView);
|
||||
}];
|
||||
|
@@ -136,14 +136,14 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
||||
sectionView.frame = CGRectMake(0, 0, KScreenWidth, sectionHeight);
|
||||
sectionView.tag = 1000 + section;
|
||||
sectionView.imageName = @"home_recommend_section_logo";
|
||||
sectionView.title = @"最新推荐";
|
||||
sectionView.title = @"为你推荐";
|
||||
sectionView.delegate= self;
|
||||
return sectionView;
|
||||
} else if (section == 3) {
|
||||
XPHomeSectionView * sectionView = [[XPHomeSectionView alloc] init];
|
||||
sectionView.frame = CGRectMake(0, 0, KScreenWidth, sectionHeight);
|
||||
sectionView.imageName = @"home_hot_section_logo";
|
||||
sectionView.title = @"人气主播";
|
||||
sectionView.title = @"人气直播";
|
||||
sectionView.tag = 1000 + section;
|
||||
sectionView.delegate= self;
|
||||
return sectionView;
|
||||
|
@@ -11,13 +11,14 @@
|
||||
///View
|
||||
#import "XPHomeHapppyRoomTableViewCell.h"
|
||||
#import "XPHomeListEmptyTableViewCell.h"
|
||||
#import "XPHomeBannerTableViewCell.h"
|
||||
///VC
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
///Model
|
||||
#import "HomePlayRoomModel.h"
|
||||
|
||||
@interface XPHomeHotRoomViewController ()<UITableViewDelegate, UITableViewDataSource>
|
||||
@interface XPHomeHotRoomViewController ()<UITableViewDelegate, UITableViewDataSource, XPHomeBannerTableViewCellDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
|
||||
@@ -48,12 +49,17 @@
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate And UITableViewDataSource
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.roomList.count > 0 ? self.roomList.count : 1;
|
||||
return self.roomList.count > 0 ? self.roomList.count : 1;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (self.roomList.count > 0) {
|
||||
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
|
||||
if (model.isBanner) {
|
||||
return 80;
|
||||
}
|
||||
return 94;
|
||||
}
|
||||
return 300;
|
||||
@@ -62,6 +68,16 @@
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (self.roomList.count > 0) {
|
||||
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
|
||||
if (model.isBanner) {
|
||||
XPHomeBannerTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPHomeBannerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
|
||||
}
|
||||
cell.delegate = self;
|
||||
cell.bannerList = model.bannerVoList;
|
||||
return cell;
|
||||
}
|
||||
|
||||
XPHomeHapppyRoomTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeHapppyRoomTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPHomeHapppyRoomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeHapppyRoomTableViewCell class])];
|
||||
@@ -69,7 +85,6 @@
|
||||
cell.roomInfo = model;
|
||||
return cell;
|
||||
}
|
||||
|
||||
XPHomeListEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPHomeListEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
|
||||
@@ -86,6 +101,28 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPHomeBannerTableViewCellDelegate
|
||||
- (void)xPHomeBannerTableViewCell:(XPHomeBannerTableViewCell *)view didClickBanner:(HomeBannerInfoModel *)info {
|
||||
switch (info.skipType) {
|
||||
case HomeBannerInfoSkipType_Room:
|
||||
{
|
||||
if (info.skipUri.length > 0) {
|
||||
[XPRoomViewController openRoom:info.skipUri viewController:self];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HomeBannerInfoSkipType_Web:
|
||||
{
|
||||
XPWebViewController *vc = [[XPWebViewController alloc]init];
|
||||
vc.url = info.skipUri;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#pragma mark - JXPagingViewListViewDelegate
|
||||
- (UIView *)listView {
|
||||
return self.view;
|
||||
@@ -121,6 +158,7 @@
|
||||
}
|
||||
[_tableView registerClass:[XPHomeHapppyRoomTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeHapppyRoomTableViewCell class])];
|
||||
[_tableView registerClass:[XPHomeListEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
|
||||
[_tableView registerClass:[XPHomeBannerTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
Reference in New Issue
Block a user