JSQMessage可能的单元大小错误

时间:2017-03-29 13:23:50

标签: ios swift jsqmessagesviewcontroller

要在CollectionView中自定义JSQPhotoMediaItem单元格的大小,我创建了一个子类:

class CustomMediaPhoto: JSQPhotoMediaItem{

    override func mediaView() -> UIView! {
        return UIView()
    }

    override func mediaViewDisplaySize() -> CGSize {
        let screen = UIScreen.mainScreen().bounds
        let screenWidth = screen.size.width * 0.6
        let size = CGSizeMake(screenWidth, screenWidth)
        print(size)        
        return size
    }    
    override func mediaPlaceholderView() -> UIView! {
        return nil
    }

    override func mediaHash() -> UInt {
        return UInt(0)
    }
}

但显示单元格时存在错误(并非总是如此,我无法找到重现错误的线性方式):

enter image description here

0 个答案:

没有答案