'Is there a way I can change the background color of the whole input bar in Message Kit?

I wish to change the background color of the input accessory bar to a reddish color. In the example code for MessageKit, there isn't any to change the background color. And running this piece of code doesn't work:

messageInputBar.backgroundColor = .red
or
messageInputBar.backgroundView.backgroundColor = .red


Solution 1:[1]

Have you tried this? :

messageInputBar.contentView.backgroundColor

Solution 2:[2]

In order to color the different parts on the InputBarAccessoryView, use these snippets:

  1. Coloring the content view:

enter image description here

messageInputBar.contentView.backgroundColor = .red
  1. Coloring the text input view:

enter image description here

messageInputBar.inputTextView.backgroundColor = .red
  1. Coloring the full view:

enter image description here

messageInputBar.backgroundView.backgroundColor = .red

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ChrisMM
Solution 2 nivbp