Swift 使用JSQMessageViewController隐藏AvatarImage会导致白色间隙

Swift 使用JSQMessageViewController隐藏AvatarImage会导致白色间隙,swift,swift2,jsqmessagesviewcontroller,Swift,Swift2,Jsqmessagesviewcontroller,我正在使用JSQMessageViewControllers库来实现聊天视图。但是,我想在聊天中隐藏化身图像 根据以下文件: 我只需要在下面的函数中返回nil override func collectionView(collectionView: JSQMessagesCollectionView!, avatarImageDataForItemAtIndexPath indexPath: NSIndexPath!) -> JSQMessageAvatarImageDataSource!

我正在使用JSQMessageViewControllers库来实现聊天视图。但是,我想在聊天中隐藏化身图像

根据以下文件:

我只需要在下面的函数中返回nil

override func collectionView(collectionView: JSQMessagesCollectionView!, avatarImageDataForItemAtIndexPath indexPath: NSIndexPath!) -> JSQMessageAvatarImageDataSource! {
    return nil
}
然而,在返回零后。对于原始化身位置的每条消息,它都有空格。


如何删除空白?

我通过在JSQMessageViewController子类中设置以下属性来删除空白,从而解决了这个问题

collectionView?.collectionViewLayout.incomingAvatarViewSize = CGSizeZero
collectionView?.collectionViewLayout.outgoingAvatarViewSize = CGSizeZero

在视图中没有加载设置

collectionView?.collectionViewLayout.incomingAvatarViewSize=.0
collectionView?.collectionViewLayout.outgoingAvatarViewSize=.0
.zero
来自CoreGraphics CGSize