Search code examples
ioschatjsqmessagesviewcontroller

hide the inputToolbar in JSQMessagesViewController


I am using JSQMessagesViewController for my chat application. When there is no internet activity I would like to hide the inputToolbar

I tried this, but that does not work:

    self.inputToolbar.frame.size = CGSize(width: 0,height: 0)

When I set this, then for less than a second it's gone:

    self.inputToolbar.preferredDefaultHeight = 0

Any idea how to do this? Maybe disabling the inputToolbar could also be good enough.


Solution

  • Instead of removing from superview and having to add back as a subview, why not just use:

    [self.inputToolbar setHidden:YES];