2016-04-29 70 views
3

我正在尝试向JSQMessageViewController添加日期标签,并且实现正确的方法,但没有任何显示。这里是我的代码:如何在Swift中的JSQMessagesViewController中添加日期标签

override func collectionView(collectionView: JSQMessagesCollectionView!, attributedTextForCellBottomLabelAtIndexPath indexPath: NSIndexPath!) -> NSAttributedString! { 
    let message: JSQMessage = self.messages[indexPath.item] 

    return JSQMessagesTimestampFormatter.sharedFormatter().attributedTimestampForDate(message.date) 
} 

谢谢!

回答

2

我想你也可能需要重写collectionView:layout:heightForCellBottomLabelAtIndexPath:

根据source,看起来默认值为0.0

相关问题