2

我正在使用JSQMessages ( https://github.com/jessesquires/JSQMessagesViewController ) 来处理我的应用程序中的聊天。

我想在 JSQMessages UI 中显示消息是否已传递、消息是否被另一端读取或传递中是否存在问题(其他聊天应用程序执行的功能相同)。

如何自定义它以显示此信息?如果消息无法传递,我的目标是添加支票、双重支票或红色感叹号。

有什么想法可以使用 JSQMessages 来完成吗?

非常感谢,

丹尼尔

4

1 回答 1

2

You can add a status enum in your JSQMessage model class to represent different delivery status flags. and in your JSQMessagesController subclass you can override this method :

- (NSAttributedString *)collectionView:(JSQMessagesCollectionView *)collectionView attributedTextForCellBottomLabelAtIndexPath:(NSIndexPath *)indexPath

and return an NSAttributedString matching the delivery flag you want to show.

Bear in mind that this has nothing to do with the backend. JSQMessages is for UI only so backend work has to be done by you.

you can get more information here : https://github.com/jessesquires/JSQMessagesViewController/issues/190

于 2015-03-09T09:26:03.263 回答