See Also: Entry Members
Entry is a single line text entry. It is best used for collecting small discrete pieces of information, like usernames and passwords.
The following example creates a new username and password set of entries.
C# Example
View CreateLoginForm ()
{
var usernameEntry = new Entry {Placeholder = "Username"};
var passwordEntry = new Entry {
Placeholder = "Password",
IsPassword = true
};
return new StackLayout {
Children = {
usernameEntry,
passwordEntry
}
};
}
The FormsGallery sample, which can be found on the Sample Applications page, has an EntryDemoPage.cs file. This file contains a longer and more complicated example.
The Xamarin.Forms.ActivityIndicator class has the following XAML properties:
| Property | Value |
|---|---|
| IsPassword | true to indicate that the Xamarin.Forms.Entry is a password field. Otherwise, false. |
| Placeholder | The default text that will appear in the control. |
| Text | The initial text that will appear in the entry. |
| TextColor | A color specification, with or without the prefix, "Color". For example, "Color.Red" and "Red" both specify the color red. |
