TextView.SetError Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SetError(ICharSequence, Drawable) |
Sets the right-hand compound drawable of the TextView to the specified icon and sets an error message that will be displayed in a popup when the TextView has focus. |
SetError(String, Drawable) |
Sets the right-hand compound drawable of the TextView to the specified icon and sets an error message that will be displayed in a popup when the TextView has focus. |
SetError(ICharSequence, Drawable)
Sets the right-hand compound drawable of the TextView to the specified icon and sets an error message that will be displayed in a popup when the TextView has focus.
[Android.Runtime.Register("setError", "(Ljava/lang/CharSequence;Landroid/graphics/drawable/Drawable;)V", "GetSetError_Ljava_lang_CharSequence_Landroid_graphics_drawable_Drawable_Handler")]
public virtual void SetError (Java.Lang.ICharSequence? error, Android.Graphics.Drawables.Drawable? icon);
[<Android.Runtime.Register("setError", "(Ljava/lang/CharSequence;Landroid/graphics/drawable/Drawable;)V", "GetSetError_Ljava_lang_CharSequence_Landroid_graphics_drawable_Drawable_Handler")>]
abstract member SetError : Java.Lang.ICharSequence * Android.Graphics.Drawables.Drawable -> unit
override this.SetError : Java.Lang.ICharSequence * Android.Graphics.Drawables.Drawable -> unit
Parameters
- error
- ICharSequence
- icon
- Drawable
- Attributes
Remarks
Sets the right-hand compound drawable of the TextView to the specified icon and sets an error message that will be displayed in a popup when the TextView has focus. The icon and error message will be reset to null when any key events cause changes to the TextView's text. The drawable must already have had Drawable#setBounds
set on it. If the error
is null
, the error message will be cleared (and you should provide a null
icon as well).
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetError(String, Drawable)
Sets the right-hand compound drawable of the TextView to the specified icon and sets an error message that will be displayed in a popup when the TextView has focus.
public void SetError (string? error, Android.Graphics.Drawables.Drawable? icon);
member this.SetError : string * Android.Graphics.Drawables.Drawable -> unit
Parameters
- error
- String
- icon
- Drawable
Remarks
Sets the right-hand compound drawable of the TextView to the specified icon and sets an error message that will be displayed in a popup when the TextView has focus. The icon and error message will be reset to null when any key events cause changes to the TextView's text. The drawable must already have had Drawable#setBounds
set on it. If the error
is null
, the error message will be cleared (and you should provide a null
icon as well).
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.