The AutoComplete control enables quick identification of user input in the search result by highlighting the matching text. For this, the AutoComplete class provides the HighlightColor property that sets the highlight color for the matching characters. You can explicitly set this property to a specific color so that the user input string gets highlighted in the search results as shown in the following image.
The following code example shows setting the text highlight feature in the AutoComplete control.
C# |
Copy Code
|
---|---|
autoComplete.HighlightColor = Xamarin.Forms.Color.Coral; |
XAML |
Copy Code
|
---|---|
<c1:C1AutoComplete x:Name="autoComplete" ItemsSource="{Binding ItemsSource}" DisplayMemberPath="Name" HorizontalOptions="FillAndExpand" HighlightColor="Coral"> |