問題描述
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的布局沒有確定
希望知道問題答案的小伙伴私信我。
大家共同進步,共同學習