Text Field

Text Field

Download PDF

Text Field

A Text Field is a control that displays editable text. You typically use this control to gather small amounts of text from the user and perform any immediate action, such as search operation based on that text.
The TextField class implements a UI control that accepts and displays text input. It provides the capability to a user, to input text.


Text boxes do have the ability to apply validation rules, such as required fields.This control can also holds a multi-line footer text area, located just below its location. This serves as a great place to add contextual information.

    Keywords:
  • text area
  • text fixer
  • text field
  • text field validation

Properties

  • Display/Text
    PARAMETER
    DESCRIPTION
    Text

    Sets text to be displayed on Text Field.

    Text Color

    Used to set the color of the Text Field.

    Font Family

    Sets the font of the text to be displayed.

    Custom Font Name

    Sets custom font name (special font, not available in default fonts) for text to be displayed in Text Field.

    Font Size

    Sets the font size of the text to be displayed.

    Text Alignment

    Used to set the alignment of the text.

    Placeholder

    The string that is displayed when there is no other text in the Text Field.

    Minimum Font Size

    The size of the smallest permissible font with which to draw the text.

    Adjusts Font Size To Fit

    To fit in the Text Field, the font size of the text gets adjusted in the Text Field.

  • Display
    PARAMETER
    DESCRIPTION
    Border Style

    Choose from the different available options and style the border used by the Text Field.

    Clear Button Mode

    Sets the mode of the button in terms of its appearance and visibility.

    Clears On Begin Editing

    A Boolean value indicating whether the Text Field removes old text when editing begins.

    Autocapitalization Type

    Sets the Auto-capitalization style for the text object.

    Autocorrection Type

    Sets the Auto-correction style for the text object.

    Keyboard Type

    Choose from the range of available types and set the keyboard style associated with the text object.

    Keyboard Appearance

    The appearance style of the keyboard that is associated with the text object. The appearance can be set as either Default or Alert.

    Return Key Type

    The contents of the “return” key can be set from the various available options as Default, Go, Google, etc. from the drop down.

    Enables Return Key Automatically

    A Boolean value indicating whether the return key is automatically enabled when the text is entered by the user.

    Secure Text Entry

    This property identifies whether the text object should hide the text being entered.

    Content Horizontal Alignment

    Sets the horizontal alignment for content (text or image or both) of button.

    Content Vertical Alignment

    Sets the vertical alignment for content (text or image or both) of button.

    Enabled

    A Boolean property to indicate whether the gesture recognizer is enabled.

    User Interaction Enabled

    Enables the Interaction with user, i.e. control responds when user taps on it.

    Alpha

    Used to set the transparency to the Button which ranges from 0 to 1.

    Background Color

    Used to set the background color to the Text Field.

  • Custom Border
    PARAMETER
    DESCRIPTION
    Border Width

    Sets border width for a control.

    Border Corner Radius

    Sets radius with which control's rounded corners should be drawn. Setting this property will enable control appear with rounded corners.

    Border Color

    Sets the border color for a control. Works only if "Border Width" property is set to a value more than 0. Default would be black color.

    Dash Width For Dashed Border

    Sets width of each dash in dashed border pattern for a control.

    Space Between Dashes For Dashed Border

    Helps set the spacing between Dashes for Dashed Border.

    Transform Angle

    Sets angle in degrees to which the Segment Controller which is in its normal state, has to be rotated. Possible values for this property are -360 to 360.

  • CIT Custom Properties
    PARAMETER
    DESCRIPTION
    Text Entry Restrictions

    The restriction entry on the user’s entry of text in the Text Field.

    Maximum Number Of Lines

    This property sets maximum number of lines that can accustom the Text Field. You can set as many lines as you wish to have. There’s no limit.

    Text Field Number Format

    This property enables the formatting of the number entered by the user in the Text Field.

    InputViewId

    The view that is displayed instead of the keyboard.

    Input Accessory View Id

    The control that will be displayed in the toolbar above the keyboard when user will start entering data in the Text Field.

    Text Field Left View Id

    The overlay displayed on the left side of the Text Field.

    Text Field Right View Id

    The overlay displayed on the right side of the Text Field.

    Count Receiver Id

    This property is for setting "Object ID" of the control on which character count of Text Field has to be displayed.

    Place Holder Text Color

    Sets color for the placeholder text.

  • Advanced
    PARAMETER
    DESCRIPTION
    Is Growing TextField

    A Boolean value to enable Text Field to increase the height in proportion to the content.

  • Object
    PARAMETER
    DESCRIPTION
    Xpos

    Sets the X position of the Text Field.

    YPos

    Sets the Y position of the Text Field.

    Width

    Sets the width of the Text Field.

    Height

    Sets the height of the Text Field.

    Object ID

    Sets unique identifier for the control. Control can be referenced with name set in this property for configuration.

    Object Parent ID

    Set "Object ID" of Text Field which contains this control or can serve as parent.

    Key Name To Data

    Sets the web service key from data received from web server, which corresponds to the value to be displayed on the control.

  • Vertical
    PARAMETER
    DESCRIPTION
    Vertical Group

    Group of vertical android default properties.

    Reference Type

    These are the android default properties to set selected view with respect of other view.

    Reference Value

    Reference object that is used for positioning selected object

    Offset Type

    marginTop : Specifies extra space on the top side of this view. This space is outside this view's bounds.
    marginBottom : Specifies extra space on the bottom side of this view. This space is outside this view's bounds.

    Offset Value

    Value define the extra space value in pixel.

    Center Vertical

    This property centers the child vertically with respect to the bounds of its parent view.

    Apply Vertical Custom Properties

    If any of the vertical layout setting parameter(s) are selected then this value is selected to indicate user applied vertical custom layout setting parameter(s)

  • Horizontal
    PARAMETER
    DESCRIPTION
    Horizontal Group

    Group of horizontal android default properties.

    Reference Type

    Reference type is the the default property to set selected view with respect to other view.

    Reference Value

    Reference object that is used for positioning selected object.

    Offset Type

    marginLeft : Specifies extra space on the left side of this view. This space is outside this view's bounds.
    marginRight : Specifies extra space on the right side of this view. This space is outside this view's bounds.

    Offset Value

    Offset Value defines the extra space value in the pixel.

    Center Horizontal

    This property centers the child horizontally with respect to the bounds of its parent view.

    Apply Horizontal Custom Properties

    If any of the horizontal layout setting parameter(s) are selected then this value is selected to indicate user applied horizontal custom layout setting parameter(s).

  • Display/Image
    PARAMETER
    DESCRIPTION
    Background

    The image that represents the background appearance of the Text Field when it is enabled.

    Disabled Background

    The image that represents the background appearance of the Text Field when it is disabled.

  • Display/AdvanceText
    PARAMETER
    DESCRIPTION
    Hide

    Hiding an element can be done by checking ‘Hide’. This property lets you hide the control.


    Advance - Sets auto resizing with respect to superview, for Text Field.

  • Layout Setting
    PARAMETER
    DESCRIPTION
    Horizontal

    Group of horizontal android default properties.

    Vertical

    Group of vertical android default properties.

    Layout Width

    Sets the width of the view
    match_parent/fill_parent : Takes the width as its parent view
    wrap_content : Takes the width as its content’s width

    Layout Height

    Sets the height of the view
    match_parent/fill_parent : Takes the height as its parent view
    wrap_content : Takes the height as its content’s height

    Left

    The padding is expressed in pixels for the left, top, right and bottom parts of the view. Padding can be used to offset the content of the view by a specific amount of pixels.
    For instance, a Left value of 2 will push the view's content by 2 pixels to the right of the left edge.

    Right

    For instance, a Right value of 2 will push the view's content by 2 pixels to the left of the right edge.

    Top

    For instance, a Top value of 2 will push the view's content by 2 pixels to the bottom of the top edge.

    Bottom

    For instance, a Bottom value of 2 will push the view's content by 2 pixels to the top of the bottom edge.

    Apply Custom Properties

    If any of the layout setting parameter(s) are selected then this value is selected to indicate user applied custom layout setting parameter(s).

    Center In Parent

    This property centers the child vertically with respect to the bounds of its parent view.

    Default Min Height

    The height of the view cannot be less than the given value.
    If user select “Default Min Height” then android default value is taken otherwise it takes 0dp.

    Default Min Width

    The width of the view cannot be less than the given value.
    If user select “Default Min Width” then android default value is taken otherwise it takes 0dp.

Actions

  • While Editing

    This event is triggered while editing search bar, i.e when a character is entered or deleted from search bar.

  • Begin Editing

    This event is triggered when user starts typing the text in the Text Field.

  • End Editing

    The action related to this event will be called when user has completed editing the text in the Text Field.

  • Done Clicked

    This event is triggered when user taps on the control. Hence the required Action can be configured on ‘Click’ event.

  • Alert Button Click

    This event is triggered when user taps a button on alert view, which was shown using “Show Alert” action, so any actions you want perform when alert button button is tapped can be configured in “Alert Button Click” event listed in ”ACTION(S)” tab of the control on which you have configured “Show Alert” action or Under Data source events of "Data sources" tab (if alert was shown on using “Show Alert” action configured in "Datasource Loaded" event of a data source in "Data Sources" list, you can configure actions of alert button click in "Alert Button Click" listed under data source events). “seletedButtonIndex” and "selectedButtonTitle" are the response parameters which indicate which button is tapped by user. Add condition for checking value of “seletedButtonIndex” or "selectedButtonTitle" response parameter value in order to configure actions for each button of alert view separately. You can access user input in alert view text fields using "alert_text_1" and "alert_text_2" response parameters in case of alert type is "SecureTextInput", "PlainTextInput" or "LoginAndPasswordInput"

    Following are the response parameters for this event :-

    1) selectedButtonIndex :- Index of the tapped button

    2) selectedButtonTitle :- Title of the tapped button

    3) alert_text_1 :- Text entered by user in text field one. If alert type is
    "SecureTextInput", "PlainTextInput" or "LoginAndPasswordInput"

    4) alert_text_2 :- Text entered by user in text field two(password). If alert type is
    "LoginAndPasswordInput"

Remarks

  • Text Entry Restrictions

    You can restrict user to enter only certain set of characters in Text Field. You need to use “Text Entry Restrictions” property for it. For “Text Entry Restrictions” property you can set values:


    numbers_only: User can enter only numbers to the Text Field control.


    characters_only: User can enter only letters to the Text Field control.


    alpha_numaric_only: User can enter both letters and numbers to the Text Field control.


    phone_number_only: User can enter only a valid phone number to the Text Field control.


    max_length: You need set this in format “max_length(n)” where “n” is the maximum number of characters you want to allow user to enter in Text View.e.g, “max_length(100).


    User can enter only upto “n” number of characters you set in brackets of max_length() restriction , in Text Field control)

  • Custom Input View

    This feature lets you design your custom input view for Text Field, which will be presented instead of default keyboard, when user tries to enter something in Text Field. You need to set “InputViewId” property to the control, which you want to present as input view to user.

  • Custom Accessory View

    You can add a custom view above standard keyboard while Text Field is being edited. You need to set “Input Accessory View Id” property to the control, which you want to add above standard keyboard.

  • Character Count Display and Maximum Character Count

    This feature lets you display number of characters entered by user on the go while Text Field is being Edited. If you set “Text Entry Restrictions(max_length(n))” property, initially maximum count will be displayed on character count display control, which will be decreased as user enters text into Text Field until character count reaches o. You need to set “Count Receiver Id” property to the control, on which you want to display character count of Text Field.

  • Growing Text Field

    This unique feature lets you add dynamic behaviour to Text Field, i.e, Text Field’s height will be increased with animation while user enters text in it. You need to enable “Is Growing Text Field” property to add this feature. You can set maximum number lines upto which Text Field can grow using “Maximum Number Of Lines” property.

  • Number Format

    When Text Field is intended to be used as an input for only numbers like, phone number, you can use this feature to format numbers entered by user with a predefined format. You need to use “Text Field Number Format” property for this. For Example, if “XX-XXX-XXX-XXXX” is set in “Text Field Number Format” property, when user enters numbers into Text Field, “X” will be replaced each number entered by user and “-” will be added at appropriate places like, “91-123-456-7890”.

  • Custom Left and Right views

    You can add controls on left and right sides of Text Field control. Use “Text Field Left View Id” property to set left view and “Text Field Right View Id” property to set right view for Text Field.