JSQMessagesViewController can not find heightForCellTopLabelAtIndexPath


JSQMessagesViewController can not find heightForCellTopLabelAtIndexPath

as my questions already says: I am currently implementing the JSQMessagesViewController component in Xamarin.iOS and everything works fine for now, but for some reason I can not find the heightForCellTopLabelAtIndexPath method as described at this link . All the other methods are visible to me, even the one that returns the attributed text for the top cell label.

Thanks for the help!

Wow I did not even know that you could use this library in Xamarin apps but also I don’t do anything in Xamarin but that is super cool. Well as per your question. I was not able to see that method either so maybe the documentation is off but to use:

override func collectionView(_ collectionView: JSQMessagesCollectionView!, layout collectionViewLayout: JSQMessagesCollectionViewFlowLayout!, heightForMessageBubbleTopLabelAt indexPath: IndexPath!) -> CGFloat {
    return firstMessageInSet(indexOfMessage: indexPath) ? 0 : kJSQMessagesCollectionViewCellLabelHeightDefault

The only difference is that it is referencing the messageBubbleTopLabel and not the CellTopLabel per say. I think that is the correct method to use.

In the screen shot provided I show how this effects the look of the messages. The first message has the size set to kJSQMessagesCollectionViewCellLabelHeightDefault and the message fallowing it has it set to 0

JSQMessagesViewController can not find heightForCellTopLabelAtIndexPath

So if that is what you are trying to achieve then this is the method for you.

原文 : Hello, buddy!


免责声明:本文内容来源于Hello, buddy!,已注明原文出处和链接,文章观点不代表立场,如若侵犯到您的权益,或涉不实谣言,敬请向我们提出检举。