0

I am trying to add Sent/Unsent status message to all outgoing chat bubbles. For this, I am retuurning 40 from heightForCellBottomLabelAtIndexPath method.

Also from attributedTextForCellBottomLabelAtIndexPath method I am returning a attributed string. For example,

  1. NSMutableAttributedString *hogan = [[NSMutableAttributedString alloc] initWithString:@"Presenting the great... Hulk Hogan!"];

  2. [hogan addAttribute:NSFontAttributeName value:[UIFont
    systemFontOfSize:20.0] range:NSMakeRange(24, 8)];

  3. [hogan addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(10, 10)];

Now after this space between my cells have increased to 40 but I can't see any text that I am returning as attributed string. Also if I keep increasing the value from 40, space between the cells keep on increasing but cell label text not visible.

Please tell me where I am doing wrong.

Dennis Kriechel
  • 3,719
  • 14
  • 40
  • 62
user3265443
  • 535
  • 1
  • 8
  • 25

2 Answers2

0

As you said that you are using attributedTextForCellBottomLabelAtIndexPath but text is not visible. Would you please follow below lines hope it helps.

Step 1: Go to the cellForRowAtIndextPath Step 2: cell.bottomLabel.text=@"Presenting the great... Hulk Hogan!"; After getting the status value from webservice, reload the collection view. At that time updated vale will be visible.

Please let me know in case of any concern.

0

Make sure you added following method in your code.

   override func collectionView(collectionView: JSQMessagesCollectionView!, layout collectionViewLayout: JSQMessagesCollectionViewFlowLayout!, heightForCellBottomLabelAtIndexPath indexPath: NSIndexPath!) -> CGFloat {
        return 30.0;
    }
Sachin Nikumbh
  • 911
  • 11
  • 11