美文网首页
Xcode8+和iOS10.3 tableCell复用问题

Xcode8+和iOS10.3 tableCell复用问题

作者: 锦鲤跃龙 | 来源:发表于2017-04-08 15:14 被阅读0次

    问题描述

    tableCell上放了一个conllectionView,结果滑动屏幕再滑动回来的时候,conllectionView的交互都失效了。解决方法都有了,但是原因不知。问题图如下:


    问题图

    问题代码

    - (void)collectionViewSetF{
        
        [_collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
            
           
            make.top.leading.trailing.mas_equalTo(self.contentView);
            
    
            
            make.height.mas_equalTo(MasScale_1080(212));
            
    //        make.bottom.mas_equalTo(self.contentView.mas_bottom).priority(600);
            
        }];
    
        
    }
    
    
    - (void)setContenViewF{
        
        
        [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self);
            
            make.leading.mas_equalTo(self.mas_leading).offset(MasScale_1080(tableViewEdge));
            
            make.trailing.mas_equalTo(self.mas_trailing).offset(MasScale_1080(-tableViewEdge));
            
            make.bottom.mas_equalTo(_collectionView.mas_bottom).priority(600);
            
            
        }];
        
    }
    

    修改后代码

    - (void)collectionViewSetF{
        
        [_collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
            
           
            make.top.leading.trailing.mas_equalTo(self.contentView);
            
            
            make.height.mas_equalTo(MasScale_1080(212));
            
            make.bottom.mas_equalTo(self.contentView.mas_bottom).priority(600);
            
        }];
    
        
    }
    
    
    - (void)setContenViewF{
        
        
        [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self);
            
            make.leading.mas_equalTo(self.mas_leading).offset(MasScale_1080(tableViewEdge));
            
            make.trailing.mas_equalTo(self.mas_trailing).offset(MasScale_1080(-tableViewEdge));
            
            make.bottom.mas_equalTo(self);
            
            
        }];
        
    }
    

    最终效果图

    改正后效果图

    思考猜想

    应该是错误代码的contentView的布局没有确定
    希望知道问题答案的小伙伴私信我。
    大家共同进步,共同学习

    相关文章

      网友评论

          本文标题:Xcode8+和iOS10.3 tableCell复用问题

          本文链接:https://www.haomeiwen.com/subject/zmblattx.html