问题看起来像这样:http: //i.imgur.com/5iaAiGQ.mp4(红色是cell.contentView的颜色)
这是代码:https://github.com/nezhyborets/UICollectionViewContentsAnimationProblem
当前状态: UICollectionViewCell的contentView的内容不会与contentView框架更改一起动画.它立即获得大小没有动画.
执行任务时遇到的其他问题: contentView也没有动画到单元格的帧更改,直到我在UICollectionViewCell子类中执行此操作:
override func awakeFromNib() {
super.awakeFromNib()
//Because contentView won't animate along with cell
contentView.frame = bounds
contentView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
}
Run Code Online (Sandbox Code Playgroud)
其他说明: 以下是单元格大小动画中涉及的代码
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
self.selectedIndex = indexPath.row
collectionView.performBatchUpdates({
collectionView.reloadData()
}, completion: nil)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let isSelected = self.selectedIndex == indexPath.row
let someSize : CGFloat = 90 //doesn't matter
let sizeK …Run Code Online (Sandbox Code Playgroud) 我使用新的iOS 11 UISwipeActionsConfigurationAPI 实现了拖尾滑动操作,我可以通过从边缘滑动来显示它们,可以一直滑动到左侧等.
但我无法通过刷回原来的位置来隐藏这些行为.如果我向左拖动一点然后向右拖动它会消失(参见gif).通过点击一个单元格也会被解雇.
官方邮件应用程序支持拖动以隐藏滑动操作,因此API中也可能有一种方法.
请参阅此处的示例项目:https://github.com/nezhyborets/ios-case-study-playgrounds/tree/master/UISwipeActionsConfiguration
在Xcode 8.1上,当我构建或存档时,框架代码签名需要花费大量时间.就像我在我的项目中使用的每个框架/ dylib看到以下(见截图)5-10-20秒.它也适用于任何系统dylib.
我甚至建议我经常这样做,This Action could not be completed. Try Again (-22421)因为我的会话耗尽时间,因为存档时间太慢.有什么想法吗?
ios ×3
animation ×1
frameworks ×1
uikit ×1
uiswipeactionsconfiguration ×1
uitableview ×1
xcode ×1