We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Background Color affects the Page Background Color

Hi,

   I changed SfBusyIndicator background to blue (BackgroundColor="Blue" ) the problem is background color of page is also set to blue. Please see below excerpts...

<ContentPage.Content>
        <Grid>
            <busyindicator:SfBusyIndicator 
                x:Name="act" 
                AnimationType="ECG"
                ViewBoxHeight="150"
                ViewBoxWidth="150"
                BackgroundColor="Blue" 
                TextColor="White"
                IsVisible="False"
                IsBusy="False" />
Thanks.



3 Replies

MK Muneesh Kumar G Syncfusion Team July 15, 2019 12:38 PM UTC

Hi Martin, 
 
Greetings from Syncfusion. 
 
We have analyzed your query and we would like to inform you that ViewBoxHeight and ViewBoxWidth property set the size for SfBusyIndicator drawing path alone, not for entire SfBusyIndicator control. So that the background fills with grid layout.  
 
If you want to set the SfBusyIndicator control size, we need to set the VerticalOptions for the Grid as per the below code snippet. 
 
 
Code Snippet : 
<Grid VerticalOptions="Start">
            <busyindicator:SfBusyIndicator 
                x:Name="act" 
                AnimationType="ECG"
                ViewBoxHeight="150"
                ViewBoxWidth="150"
                BackgroundColor="Blue" 
                TextColor="White"
                IsVisible="true"
                IsBusy="true" />
 </Grid>
 
  
Please check the sample and let us know if you have any concern. 
 
Regards, 
Muneesh Kumar G. 



MS Martin Sato July 25, 2019 12:58 AM UTC

Hi,
   
   I am attaching a simple project demonstrating the issue.

Thanks.

Attachment: SampleBusyIndicator_9248336f.rar


MK Muneesh Kumar G Syncfusion Team July 25, 2019 08:44 AM UTC

Hi Martin, 
 
Thanks for your update.  
 
We have analyzed your attachment and we would like to let you know that when placed SfBusyIndicator in the Grid, it will occupy the whole space. To achieve your requirement, we need to provide the HeightRequest or Grid should be separated as Rows for the control. We have modified the sample from the below link. 
 
 
Code Snippet: 
 <Grid HorizontalOptions="Start" VerticalOptions="Start">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <busyindicator:SfBusyIndicator VerticalOptions="Start" Grid.Row="0"
                x:Name="act" 
                AnimationType="ECG"
                ViewBoxHeight="150"
                ViewBoxWidth="150"
                BackgroundColor="Blue" 
                TextColor="White"
                IsVisible="true"
                IsBusy="true" />
       <StackLayout>
            <!-- Place new controls here -->
            <Label Text="Welcome to Xamarin.Forms!" 
           HorizontalOptions="Center" Grid.Row="1"
           VerticalOptions="CenterAndExpand" />

       </StackLayout>
    </Grid> 
 
 
Regards,
Muneesh Kumar G.  
 
 


Loader.
Live Chat Icon For mobile
Up arrow icon