私は JSQMessagesViewController を使用しており、JSQMediaItem を継承するカスタムの写真と音声の MediaItems を作成しています。これら 2 つのメッセージ タイプの mediaView は異なります。これら 2 種類のメッセージを送受信するときはすべて問題なく動作しますが、ループを使用して履歴メッセージをロードすると、正しく表示されません。
すべての mediaMessage が最初の mediaMessage のセル サイズを再利用したようです。しかし、写真/音声メッセージを送信すると、新しく送信されたメッセージが正しく表示されます。
私の cellForItemAtIndexPath メソッドは次のとおりです。
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = super.collectionView(collectionView, cellForItemAtIndexPath: indexPath)
return cell
}
メッセージ読み込みコード:
for msg in msgs {
let jsqMessage = self.genJSQMessage(msg)
self.messages.append(jsqMessage)
self.finishSendingMessageAnimated(true)
}
私は本当に混乱しています。アドバイスや提案をいただければ幸いです。

