EditText
Overview
Text input field
Example
<EditText android:layout_height="wrap_parent"
android:layout_width="match_parent"
android:tag="btn"
android:text="Button"
android:textColor="#669999"
android:textSize="14dp"
android:gravity="center"
android:maxLength="12"
android:hint="I am a hint"
/>
Properties
Common Properties
Private Properties
| Property | Description | Values |
|---|---|---|
| layout_weight | Child weight | Number When the parent is LinearLayout, child controls can set weight |
| gravity | Internal control alignment | Usage reference top bottom left right center_vertical fill_vertical center_horizontal fill_horizontal center fill clip_vertical clip_horizontal |
| hit | Input hint | String |
| text | Text | String |
| textColor | Text color | Hex, e.g. #FFFFFF |
| textSize | Text size | specific number + dp |
| maxLength | Maximum text length | specific number |
| lines | Number of lines | specific number |
| maxLines | Maximum lines | specific number |
| ellipsize | Truncation when text exceeds width | start: ellipsis at start end: ellipsis at end middle: ellipsis in middle marquee: horizontal scroll (requires focus) none: no truncation |
| inputType | Input type | text: text phone: phone number number: number textPassword: text password numberPassword: numeric password |