Appearance and Styling
8 May 20191 minute to read
When the default view is not needed, you can customize the view of Xamarin.Forms SfRating control. The SfRating control provides support to customize the size, item count, and space between rating items.
Set size
The ItemSize
property sets the size for the rating items.
NOTE
The default value of this property is 50.
rating.ItemSize=20;
Set space between items
The ItemSpacing
property sets spacing between the rating items.
NOTE
The default value of this property is 5.
rating.ItemSpacing=20;
Set number of items
The ItemCount
property sets the number of rating items to be displayed.
NOTE
The default value of this property is 5.
rating.ItemCount = 4;
Rating Settings
For styling customization, Set the RatingSettings
property value with SfRatingSettings
object instance.
SfRatingSettings ratingSettings = new SfRatingSettings();
ratingSettings.RatedFill = Color.Gray;
After adding RatingSettings
add the RatingSettings instance to SfRating
instance.
rating.RatingSettings = ratingSettings;