0
までスクロールしようとすると奇妙なバグ、collectionViewビューが最後の2番目のメッセージにスクロールします。ただし、最後の2番目のものにスクロールします。コレクションビューの下にスクロールするには、このコードを使用して
private func scrollToBottom() {
let lastSectionIndex = (ChatCollectionView?.numberOfSections())! - 1
let lastItemIndex = (ChatCollectionView?.numberOfItemsInSection(lastSectionIndex))!-1
let indexPath = NSIndexPath(forItem: lastItemIndex, inSection: lastSectionIndex)
ChatCollectionView!.scrollToItemAtIndexPath(indexPath, atScrollPosition: UICollectionViewScrollPosition.Bottom, animated: false)
}
その
私はあなたのコードを使用しますが、私は正しい結果を得ています。 – Catoshi