- Home
- Forum
- Xamarin.Forms
- Change the clear button icon
Change the clear button icon
Hi,
Attachment: Capture_891de6cc.zip
Is there a way to display a custom icon for theSfAutoComplete control? Currently the control displays an X in a circle but we would like to display a custom image.
Thanks,
Scott
Scott
Attachment: Capture_891de6cc.zip
SIGN IN To post a reply.
2 Replies
HM
Hemalatha Marikumar
Syncfusion Team
October 30, 2019 11:10 AM UTC
Hi Scott Roberts,
Greetings from Syncfusion.
Query: Display custom image instead of default close button.
We would like to let you know that close button icon on SfAutoComplete is default one and we don’t have a support to customize it. But your requirement has been achieved with the help of SfComboBox. We have a customization option for dropdown button on SfComboBox. Using DropDownButtonSettings’s View property, we can add custom image on it as per the following code snippet.
Note:
Default mode of SfComboBox is non-editable mode. To make a similar look of SfAutoComplete, sets AllowFiltering and IsEditable property as True.
Code Snippet [XAML]:
|
<combobox:SfComboBox HeightRequest="40"
IsEditableMode="True"
AllowFiltering="True"
ShowClearButton="False"
ValueChanged="ComboBox_ValueChanged"
x:Name="comboBox">
………
<combobox:DropDownButtonSettings.View>
<Image x:Name="dropDownImage" Source="DeleteButton.png" HeightRequest="30" WidthRequest="30" IsVisible="false" HorizontalOptions="Center" VerticalOptions="Center"> <Image.GestureRecognizers> <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" NumberOfTapsRequired="1"/> </Image.GestureRecognizers> </Image> </combobox:DropDownButtonSettings.View> </combobox:DropDownButtonSettings> </combobox:SfComboBox>
|
Sample Link:
Output:
Please check the sample and let know if you need any other further assistance.
Regards,
Hemalatha M.
HM
Hemalatha Marikumar
Syncfusion Team
October 30, 2019 11:14 AM UTC
Hi Scott Roberts,
Greetings from Syncfusion.
Query: Display custom image instead of default close button.
We would like to let you know that close button icon on SfAutoComplete is default one and we don’t have a support to customize it. But your requirement has been achieved with the help of SfComboBox. We have a customization option for dropdown button on SfComboBox. Using DropDownButtonSettings’s View property, we can add custom image on it as per the following code snippet.
Note:
Default mode of SfComboBox is non-editable mode. To make a similar look of SfAutoComplete, sets AllowFiltering and IsEditable property as True.
Code Snippet [XAML]:
|
<combobox:SfComboBox HeightRequest="40"
IsEditableMode="True"
AllowFiltering="True"
ShowClearButton="False"
ValueChanged="ComboBox_ValueChanged"
x:Name="comboBox">
………
<combobox:DropDownButtonSettings.View>
<Image x:Name="dropDownImage" Source="DeleteButton.png" HeightRequest="30" WidthRequest="30" IsVisible="false" HorizontalOptions="Center" VerticalOptions="Center"> <Image.GestureRecognizers> <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" NumberOfTapsRequired="1"/> </Image.GestureRecognizers> </Image> </combobox:DropDownButtonSettings.View> </combobox:DropDownButtonSettings> </combobox:SfComboBox>
|
Sample Link:
Output:
Please check the sample and let know if you need any other further assistance.
Regards,
Hemalatha M.
SIGN IN To post a reply.
- 2 Replies
- 2 Participants
-
SR Scott Roberts
- Oct 29, 2019 10:12 PM UTC
- Oct 30, 2019 11:14 AM UTC