Changing background color of header icon

If i use an SfExpander as follows:

var layout = new StackLayout
            {
                Margin = new Thickness(0, 20, 0, 20),
                Spacing = 10,
            };
            var headerGrid = new Grid()
            {
                RowDefinitions =
                    {
                        new RowDefinition {Height = new GridLength(1, GridUnitType.Star) },
                    },
                ColumnDefinitions =
                    {
                        new ColumnDefinition {Width = new GridLength(1, GridUnitType.Star) },
                    },
                BackgroundColor = Color.FromHex(HJHexColors.HJBlack),
            };
            headerGrid.Children.Add(new Label()
            {
                Text = "Terms and Conditions",
                BackgroundColor = Color.FromHex(HJHexColors.HJBlack),
                TextColor = Color.FromHex(HJHexColors.HJWhite),
                Margin = new Thickness(5),
            });
            layout.Children.Add(new SfExpander()
            {
                Header = headerGrid,
                Content = new TermsLabel(),
                HeaderIconPosition = IconPosition.End,
            });

The background of the header is black but the background of header icon is white.

How do I change the background color of the header icon area?

3 Replies

SS SaiGanesh Sakthivel Syncfusion Team March 24, 2020 08:49 AM UTC

Hi Tjismh, 
 
Thank you for using syncfusion product. 
 
We have checked the reported query “change the back ground color of header icon” from our end. We would like to let you to inform that you can achieve your requirement by using the HeaderBackgroundColor inside the Expander. Please refer the following code snippet for the reference. 
 
Code Snippet 
layout.Children.Add(new SfExpander() 
{ 
    HeaderBackgroundColor = Color.Black, 
    Header = headerGrid, 
    Content = new Label(){ 
    Text="Veg pizza is prepared " 
    }, 
HeaderIconPosition = IconPosition.End, 
}); 
 
Please refer the following UG link for the reference. 
 
We hope this helps. Please let us know, if need any further assistance. 
 
Regards, 
SaiGanesh Sakthivel


TJ TJISMH March 24, 2020 12:19 PM UTC

Thanks. Should have been able to figure that one out myself :)


LN Lakshmi Natarajan Syncfusion Team March 25, 2020 05:07 AM UTC

Hi Tjismh, 
  
Thank you for the update. 
  
We are glad that our solution meets your requirement. Please let us know if you need any further update. As always we are happy to help you out. 
  
Regards, 
Lakshmi Natarajan 


Loader.
Up arrow icon