mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
add sample code snippet for maxLength property (#4429)
* add sample code snippet for maxLength property * removing Page and StackLayout * remove the other Page tag
This commit is contained in:
committed by
Alexander Vakrilov
parent
213722fd81
commit
f9ec0c9aba
@@ -10,12 +10,8 @@ Using a TextField requires the text-field module.
|
||||
{%snippet require-textfield%}
|
||||
### Binding two TextFields text property to observable view-model property.
|
||||
```XML
|
||||
<Page loaded="pageLoaded">
|
||||
<StackLayout orientation="vertical">
|
||||
{%raw%}<TextField text="{{ someProperty }}" />
|
||||
<TextField text="{{ someProperty }}" />{%endraw%}
|
||||
</StackLayout>
|
||||
</Page>
|
||||
{%raw%}<TextField text="{{ someProperty }}" />
|
||||
<TextField text="{{ someProperty }}" />{%endraw%}
|
||||
```
|
||||
{%snippet binding-text-property-textfield%}
|
||||
## Creating a TextField
|
||||
@@ -34,3 +30,8 @@ Using a TextField requires the text-field module.
|
||||
{%snippet setting-secure-property%}
|
||||
### Binding secure property directly to model
|
||||
{%snippet binding-secure-property%}
|
||||
### Setting the maxLength property of a TextField
|
||||
```
|
||||
<TextField autocorrect="false" hint="Setting Max text length(max 3 characters)" maxLength="3" />
|
||||
<TextField autocorrect="false" hint="Setting Max text length(max 3 characters) with secure='true'" maxLength="3" secure="true" />
|
||||
```
|
||||
Reference in New Issue
Block a user