public class

TextField

extends TextEdit
java.lang.Object
   ↳ com.neomades.ui.View
     ↳ com.neomades.ui.TextEdit
       ↳ com.neomades.ui.TextField
Known Direct Subclasses

Class Overview

A TextField is a View that allows the editing of a single line of text.

Cross Platform Considerations

Default properties

By default, the following properties are applied to a new TextField:

  • focusable (limited to some devices)
  • clickable
  • enabled
  • autoCorrect: true
  • no text
  • width content stretch: MATCH_PARENT.
  • height content stretch: MATCH_CONTENT.
  • content alignment : LEFT|VCENTER.

If the text is longer than the TextField, it becomes horizontaly scrollable. The size of the TextField does not change.

Summary

[Expand]
Inherited XML Attributes
From class com.neomades.ui.TextEdit
From class com.neomades.ui.View
[Expand]
Inherited Constants
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
Public Constructors
TextField()
Constructs a new text field with no text, no default text
TextField(String text)
Constructs a TextField with given text, no default text, and default edit mode
TextField(String defaultText, String text)
Constructs a TextField with given text, given default text, and default edit mode
TextField(int resId)
Constructs a TextField with given text, no default text, and default edit mode
TextField(int defaultTextId, int textId)
Constructs a TextField with given text, given default text, and default edit mode
[Expand]
Inherited Methods
From class com.neomades.ui.TextEdit
From class com.neomades.ui.View
From class java.lang.Object

Public Constructors

public TextField ()

Constructs a new text field with no text, no default text

public TextField (String text)

Constructs a TextField with given text, no default text, and default edit mode

Parameters
text the text of this text field

public TextField (String defaultText, String text)

Constructs a TextField with given text, given default text, and default edit mode

Parameters
defaultText the default text of this field
text the text of this text field

public TextField (int resId)

Constructs a TextField with given text, no default text, and default edit mode

Parameters
resId the string id representing the text of this text field

public TextField (int defaultTextId, int textId)

Constructs a TextField with given text, given default text, and default edit mode

Parameters
defaultTextId the string id representing the default text of this field
textId the string id representing the text of this text field