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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can't adjust thickness

Thread ID:

Created:

Updated:

Platform:

Replies:

145741 Jul 5,2019 05:49 PM UTC Jul 9,2019 12:08 PM UTC Xamarin.Forms 4
loading
Tags: SfProgressBar
Alex
Asked On July 5, 2019 05:49 PM UTC

I'm trying to create a progress bar to show the progress of a file upload. I've got it working nicely but I can't seem to adjust the thickness of the progress bar.
It seems like when I add Thickness="10" or even Thickness="20" that the thickness of the bar doesn't actually change. I also add Padding="2" or Padding="10" and instead of increasing the bar's thickness, it just seems to push the actual progress bar off the screen so that only the track is visible (still at incorrect thickness).


This is my code:

<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" Padding="0,10,20,10" VerticalOptions="CenterAndExpand">
<Label IsVisible="{Binding UploadInProgress}" Text="Uploading file..." VerticalOptions="Center" LineBreakMode="NoWrap" />
<progressBar:SfLinearProgressBar Progress="{Binding AttachProgress}" TrackColor="DarkGray" ProgressColor="DeepSkyBlue" 
VerticalOptions="Center" HorizontalOptions="FillAndExpand" 
Minimum="0" Maximum="1" CornerRadius="15">
<progressBar:SfLinearProgressBar.RangeColors>
<progressBar:RangeColorCollection>
<progressBar:RangeColor IsGradient="True" Color="#337ab7" Start="0" End="0.5"/>
<progressBar:RangeColor IsGradient="True" Color="DeepSkyBlue" Start="0.5" End="1"/>
</progressBar:RangeColorCollection>
</progressBar:SfLinearProgressBar.RangeColors>
</progressBar:SfLinearProgressBar>
</StackLayout>

Dilli Babu Nandha Gopal [Syncfusion]
Replied On July 8, 2019 05:45 AM UTC

Hi Alex, 
 
Thank you for contacting Syncfusion support. 
 
Yes, it is possible to set the height of progress bar by using “TrackHeight” property.  Please refer the following documentation link which illustrates how to set the height of progress bar. 
 
Please let us know if you need any further assistance on this. 
 
Regards, 
Dilli babu. 


Alex
Replied On July 8, 2019 05:08 PM UTC

Hi Alex, 
 
Thank you for contacting Syncfusion support. 
 
Yes, it is possible to set the height of progress bar by using “TrackHeight” property.  Please refer the following documentation link which illustrates how to set the height of progress bar. 
 
Please let us know if you need any further assistance on this. 
 
Regards, 
Dilli babu. 


Dilli,

This does not work at all. I have attached a sample project showing it not working.



Attachment: ProgressBarTest_47ad986a.zip

Alex
Replied On July 8, 2019 05:25 PM UTC

What I am finding is:
  • If you set TrackHeight="10" and Padding="2", the progress bar will show the progress at the incorrect position.
  • If you set TrackHeight="10" and Padding="0", the progress bar will show at the correct position, but the height of the bar will not actually change.
I believe the documentation is misleading because what it seems you actually need to do is set both TrackHeight and HeightRequest to the same value.
If you say TrackHeight="10" and HeightRequest="10", you will see the desired result. The documentation states that you need to use TrackHeight and Padding together, when it should probably say HeightRequest instead of Padding, since padding does not directly effect the actual height of the track.

I would also like to suggest that the code is changed to make TrackHeight affect HeightRequest automatically somehow so that you don't need to set both. That would be a lot more understandable for people trying to make a larger progress bar. Then the last thing to fix is how setting a Padding value without HeightRequest messes up the progress bar's position.

Devaraj Sekar [Syncfusion]
Replied On July 9, 2019 12:08 PM UTC

Hi Alex, 
 
Thank you for the update. 
 
We are able to reproduce the reported problem at our end which seems to Xamarin Layout behavior. We need to set Layout Options according to the Stack Layout Orientation to allocate spacing for the individual view getting added in the Stack Layout, which is stated in the below MSDN link. 
 
 
 
 
We have modified the provided sample to achieve the mentioned requirement which is available in the following link. 
 
Sample Screenshot: 
 
 
So, when a Track Height of SfLinearProgressBar inside Stack Layout need to be increased then LayoutOptions must be FillAndExpand or height request need to be set which is a Xamarin Forms behaviors. Kindly let us know if you require any further assistance.  
 
Regards, 
Devaraj S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon