项目中要实现UITableViewCell里面嵌套UICollectionView, 通过监听UICollectionView的contentSize 改变UITableViewCell的高度. 使用过程中出现UITableViewCell被遮挡显示不全下个分区商品区头题目遮挡上一个商品.,在把cell滑出屏幕后显示正常的bug问题
1.UITableViewCell
1)文件.h
// HomeMidousQuTabCell.h
// MiDouShu
//
// Created by mac on 2018/11/22.
// Copyright © 2018年 zlz. All rights reserved.
//
#import <UIKit/UIKit.h>
@class HomeMidouGoodsListMjModel; //米豆商品
NS_ASSUME_NONNULL_BEGIN
@interface HomeMidousQuTabCell : UITableViewCell<UICollectionViewDelegate,UICollectionViewDataSource>
@property (nonatomic, copy) void(^reloadBlock)(NSInteger type);
@property(nonatomic,weak) UIViewController *vc;
@property(nonatomic,strong) UIImageView *mainImgv;
@property(nonatomic,strong) UICollectionView *myColView;
@property(nonatomic,strong) UICollectionViewFlowLayout *flowLayout;
@property(nonatomic,strong) NSMutableArray *arr_midouGoods; //米豆商品列表
@property(nonatomic,strong) NSMutableArray *arr_midouBanners; //米豆gg
@end
2).文件.m
#import "HomeMidousQuTabCell.h"
//#import "HomeGoodsQuColCell.h" //样式:米豆,价格 是一行显示 弃用---->>>现在使用米豆价格2行显示
#import "HomeGoodsQuSecStytleColCell.h" //首页商品样式 >>>>> 米豆,现金 2行显示
#import "HomeMidouGoodsListMjModel.h" //米豆商品
#import "HomeBannerMJModel.h"
#import "HomeGoodsDetailViewController.h" //商品详情
@interface HomeMidousQuTabCell ()
@end
@implementation HomeMidousQuTabCell
-(void)setVc:(UIViewController *)vc{
_vc = vc;
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self drawView];