ToolTip in Xamarin Rating (SfRating)

18 Oct 20222 minutes to read

Tooltip provides additional information about objects that are unfamiliar to users and are not directly displayed in UI. In the Xamarin.Forms SfRating control, tooltip shows the data of Value. It will be displayed when the mouse is hovered over the rating items and will be disappeared when a rating item is selected.

Set Tooltip Placement

Using ToolTipPlacement property, We can define where the ToolTip need to be displayed. ToolTipPlacement having the following three types of placement.

NOTE

By default, this property value is set to None.

BottomRight

The Tooltip will display on bottom of the SfRating control.

<rating:SfRating TooltipPlacement="BottomRight" />
SfRating rating;
public MainPage()
{
    InitializeComponent();
    rating = new SfRating();
    rating.TooltipPlacement = TooltipPlacement.BottomRight;
}

SfRating right bottom ToolTip

TopLeft

The Tooltip will be displayed on top of the SfRating control.

<rating:SfRating TooltipPlacement="TopLeft" />
SfRating rating;
public MainPage()
{
    InitializeComponent();
    rating = new SfRating();
    rating.TooltipPlacement = TooltipPlacement.TopLeft;
}

SfRating top left ToolTip

None

When we set ToolTipPlacement as None, The ToolTip will be disappear.

<rating:SfRating TooltipPlacement="None" />
SfRating rating;
public MainPage()
{
    InitializeComponent();
    rating = new SfRating();
    rating.TooltipPlacement = TooltipPlacement.None;
}

No tooltip

Set ToolTip Precision

The ToolTipPrecision property sets the number precisions to be displayed after decimal point in ToolTip.

NOTE

The default value of ToolTip precision is 1.

<rating:SfRating TooltipPrecision="6" />
SfRating rating;
public MainPage()
{
    InitializeComponent();
    rating = new SfRating();
    rating.TooltipPrecision = 6;
}

SfRating ToolTip precision