MaskedEditText
MaskedEditText
Events:
- EnterPressed
- Filter (NewText As String, Position As Int, Replace As Boolean) As String
- FocusChanged (HasFocus As Boolean)
- TextChanged (Old As String, New As String)
Fields:
- INPUT_TYPE_DECIMAL_NUMBERS As Int
- INPUT_TYPE_NONE As Int
- INPUT_TYPE_NUMBERS As Int
- INPUT_TYPE_NUMBERS_WITH_SIGN As Int
- INPUT_TYPE_PHONE As Int
- INPUT_TYPE_TEXT As Int
- INPUT_TYPE_TEXT_WITH_CAPS As Int
Methods:
- BringToFront
- EnableFloatingHint
A floating hint is a hint that moves above the EditText when the user starts typing.
- Initialize (arg1 As String)
- Invalidate
- Invalidate2 (arg0 As Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- IsInitialized As Boolean
- RemoveView
- RequestFocus As Boolean
- SelectAll
Selects the entire text.
- SendToBack
- SetBackgroundImage (arg0 As Bitmap)
- SetFromHTML (HTML As String)
Replaces the text with a conversion of the provided HTML string.
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- ShowError (Message As String)
Sets an icon and an error message that will be displayed in a popup when the EditText has focus.
The icon and error message will be cleared if Message is empty or the text is modified.
Properties:
- Background As Drawable
Gets or sets the background drawable. Setting this property in the designer has no effect.
- Color As Int [write only]
- CompactText As String [read only]
Returns a copy of the text without the leading and trailing spaces, and without the placeholders if Format is not empty.
- Enabled As Boolean
- ForceDoneButton As Boolean [write only]
By default the OS sets the virtual keyboard action key to display Done or Next according to the specific layout.
You can force it to display Done by setting this value to True.
- Format As String
Gets or sets the input mask.
Mask characters:
# = Digit
L = Letter
A = Alphanumeric
H = Hexadecimal
? = Any character
Examples:
- Date & time = "##/##/#### ##:##"
- Phone number = "(###) ###-####"
- IP address = "###.###.###.###"
- MAC address = "HH:HH:HH:HH:HH:HH"
- Parental lock password = "AAAA"
- Gravity As Int
- Height As Int
- Hint As String
Gets or sets the text that will appear when the EditText is empty.
- HintColor As Int
Gets or sets the hint text color.
- InputType As Int
Gets or sets the input type flag. This flag is used to determine the settings of the virtual keyboard.
The value is one of the INPUT_TYPE constants.
- Left As Int
- Parent As Object [read only]
- PasswordMode As Boolean [write only]
Sets whether the EditText should be in password mode and hide the actual characters.
Default = False
- Placeholder As Char
Gets or sets the placeholder character for the input mask.
Default = '_'
- ReadOnly As Boolean
Gets or sets whether the EditText is editable.
Default = False
- SelectionEnd As Int [read only]
Gets the selection end position (or the cursor position).
Returns -1 if there is no selection or cursor.
- SelectionStart As Int
Gets or sets the selection start position (or the cursor position).
Returns -1 if there is no selection or cursor.
- SingleLine As Boolean [write only]
Sets whether the EditText should be in single line mode or multiline mode.
Default = False
- Tag As Object
- Text As String
Gets or sets the text.
Ignores the ReadOnly setting.
- TextColor As Int
- TextSize As Float
- Top As Int
- Typeface As Typeface
- Visible As Boolean
- Width As Int
- WithSuggestions As Boolean [write only]
Sets whether the virtual keyboard displays any dictionary-based candidates.
This setting is automatically set to False if Format is not empty or there's a handler for the Filter event (this incompatibility is due to a bug in ICS and JellyBean).
This setting is ignored when InputType is Numbers or Phone, or when PasswordMode is True.
Default = False
- Wrap As Boolean [write only]
Sets whether the text content will wrap within the EditText bounds. Relevant when the EditText is in multiline mode.