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

730 Views Asked by At

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
2

There are 2 best solutions below

0
Mahshid Sharif On

Have you tried this? :

messageInputBar.contentView.backgroundColor
0
nivbp On

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