如何解决当项目宽度大于CollectionView宽度时,iOS UICollectionView ConsoleLog警告
我正在为项目使用UICollectionView,并且将比collectionView宽度更大的Item放置为隐藏selectionButton / DeleteButton并在“编辑”模式或“滑动”时显示它们
一切正常,但ConsoleLog EveryTime中有警告消息
据我所知,有些消息我可以忽略,但是我想知道是否可以忽略它
可以将项目的宽度设置为大于collectionView的宽度,而忽略该消息吗?
我不想让您浪费时间阅读代码的每一行并为我修复
所以,我只希望听到您的想法,如果有一些要点,在使用这种方式时应格外小心:)
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};
layout: <UICollectionViewFlowLayout: 0x10571ae80>;
dataSource: <IssueTracker.IssueListCollectionViewAdapter: 0x28279a2c0>>.
解决方法
我认为,实现此功能的最佳方法是禁用按钮,并通过更改文本颜色的Alpha使其外观动画。我在视频应用程序中以这种方式实现了它,并且效果很好!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。