当项目宽度大于CollectionView宽度时,iOS UICollectionView控制台日志警告



我正在为我的项目使用UICollectionView,我放置了比collectionView宽度更大的Item来隐藏selectionButton/DeleteButton,并在编辑模式或切换时显示它们

一切都很好,但ConsoleLog EveryTime 中有警告信息

正如我所知,有些消息我可以忽略,但我想知道忽略它是否可以

可以为项目设置比集合更大的宽度查看宽度并忽略该消息吗?

我不希望你浪费时间阅读我的每一行代码并为我修复

所以,我只是希望听到你的想法,如果有一些要点,我在使用这种方式时应该小心:(

2020-11-01 19:08:14.917103+0900 IssueTracker[27304:7532603] The behavior of the UICollectionViewFlowLayout is not defined because:
2020-11-01 19:08:14.917210+0900 IssueTracker[27304:7532603] the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.
2020-11-01 19:08:14.917241+0900 IssueTracker[27304:7532603] Please check the values returned by the delegate.
2020-11-01 19:08:14.917601+0900 IssueTracker[27304:7532603] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x10571ae80>, and it is attached to <UICollectionView: 0x10a811800;
frame = (0 172; 414 515); clipsToBounds = YES;
autoresize = RM+BM;
gestureRecognizers = <NSArray: 0x2829d5290>;
layer = <CALayer: 0x282780ea0>;
contentOffset: {0, 0};
contentSize: {414, 101};
adjustedContentInset: {0, 0, 0, 0};
layout: <UICollectionViewFlowLayout: 0x10571ae80>;
dataSource: <IssueTracker.IssueListCollectionViewAdapter: 0x28279a2c0>>.

我认为实现它的最佳方法是禁用按钮,并通过更改文本颜色的alpha来设置其外观的动画。我在我的视频应用程序中以这种方式实现了它,它非常完美!

最新更新