Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Forms: Add Clear Entry

Can you point me into the right direction: How can I achieve in Xamarin.Forms a clear entry button with behavior. The behavior would be: When tapping to clear icon the entry's content on the android and iOS side the content will be deleted.

By default the entry control does't have this.

enter image description here

The result would be:

enter image description here

like image 252
Calin Vlasin Avatar asked Nov 06 '17 13:11

Calin Vlasin


People also ask

How do I create a pop up form in Xamarin?

Xamarin. Forms has three methods on the Page class for interacting with the user via a pop-up: DisplayAlert , DisplayActionSheet , and DisplayPromptAsync . They are rendered with appropriate native controls on each platform.

Is password in Xamarin Forms?

To create a password entry with toggleable password visibility in Xamarin. Forms, an image button can be added to the entry field which toggles the flag for password input. To make the implementation reusable, it can be wrapped in a custom view.


1 Answers

The ClearButtonVisibility property has been added in a new Xamarin.Forms, so there is no need for custom renderers right now. For example:

<Entry Text="Xamarin.Forms"
       ClearButtonVisibility="WhileEditing" />

See Display a clear button in Xamarin.Forms documentation.

like image 101
Rython Avatar answered Oct 03 '22 00:10

Rython