- Home
- Forum
- Xamarin.Forms
- SfChatMessageInputViewBackgroundColor
SfChatMessageInputViewBackgroundColor
I'm following the documentation here:
https://help.syncfusion.com/xamarin/chat/styles
And trying to set the background of the input view area transparent. It's not working and the input view area background remains gray. Can I clarify a few things from the documentation?
syncTheme:SyncfusionThemeDictionary is never defined. Should it be this:
xmlns:syncTheme="clr-namespace:Syncfusion.XForms.Themes;assembly=Syncfusion.Core.XForms"
This line isn't actually needed, correct:
<x:String x:Key="SfChatTheme">CustomTheme</x:String>
Also, not a question, but a note, the sample code won't actually run. It needs a key, like this:
<syncTheme:SyncfusionThemeDictionary x:Key="anything_at_all_can_go_here">
SIGN IN To post a reply.
4 Replies
1 reply marked as answer
KK
Karthikraja Kalaimani
Syncfusion Team
December 14, 2020 11:39 AM UTC
Hi Brad,
Please refer to the below code snippet to access the SfChatInputViewBackgroundColor from code behind.
Code snippet :
Please refer to the below code snippet to access the SfChatInputViewBackgroundColor from code behind.
Code snippet :
|
var listview = (SfListView)sfChat.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("ChatListView")).GetValue(sfChat);
listview.FooterSize = 0;
FooterView footerView = (FooterView)(this.sfChat.Content as Grid).Children[1];
ContentView contentView = (ContentView)(footerView as Grid).Children[1];
var border = (contentView.Content as SfBorder);
((border.Content as Grid).Children[0] as Editor).BackgroundColor = Color.Red;
|
Regarding the Documentation correction, we will correct it and the details on or before 16th December 2020. We appreciate your patience until then.
Regards,
Karthik Raja
Marked as answer
BD
Brad Dean
December 14, 2020 04:36 PM UTC
Thank you Kathik. However, when I try that ((border.Content as Grid).Children[0] as Editor) is null and BackgroundColor cannot be set. I've tried it in the page init and also in OnAppearing().
BD
Brad Dean
December 14, 2020 04:56 PM UTC
Update: it looks like this is the correct code to make the background transparent. It can be run from the code behind Init on a non-UI thread.
Can I put in a feature request to make this a XAML property like the BackgroundColor setting?
var listview = (SfListView)this.SfChat.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("ChatListView")).GetValue(this.SfChat);
FooterView footerView = (FooterView)(this.SfChat.Content as Grid).Children[1];
ContentView contentView = (ContentView)footerView.Children[1];
contentView.BackgroundColor = Color.Transparent;
Thanks!
KK
Karthikraja Kalaimani
Syncfusion Team
December 15, 2020 05:26 AM UTC
Hi Brad,
Thanks for the update.
We glad to know that your requirement has been achieved at your end. Please let us know if you need further assistance from us.
Regarding “Feature request for InPutView background color”, yes you can put a feature request in our feedback portal and you can get updates from SfChat team.
Regards,
Karthik Raja
Thanks for the update.
We glad to know that your requirement has been achieved at your end. Please let us know if you need further assistance from us.
Regarding “Feature request for InPutView background color”, yes you can put a feature request in our feedback portal and you can get updates from SfChat team.
Regards,
Karthik Raja
SIGN IN To post a reply.
- 4 Replies
- 2 Participants
- Marked answer
-
BD Brad Dean
- Dec 11, 2020 06:01 PM UTC
- Dec 15, 2020 05:26 AM UTC