Приложение Nativescript: я создаю динамические текстовые поля.
1) Проблема. Когда я нажимаю на динамически генерируемое текстовое поле, клавиатура отображается на миллисекунды и исчезает. Когда я нажимаю очень быстро несколько раз, клавиатура остается.
2) Как сделать событие onChange/onBlur для динамически сгенерированного TextField? Например, когда я обновляю текстовое поле, мне нужно вызвать метод.
Вот текущий список: (размытие) Не работает: <StackLayout col="1" row="0">
<ListView [items]="categoryService.attributes | async">
<template let-item="item" let-i="index">
<GridLayout rows="50 100">
<Label [text]="item.name"></Label>
<TextField #input *ngIf="item.type=='text'" row="1" hint="Enter Value here" [text]="item.name" (blur)="categoryService.onAttributeChange(item, item.type, null, input.value)"></ TextField>
<Switch #switch *ngIf="item.type=='checkbox'" row="1" checked="false" (checkedChange)="categoryService.onAttributeChange(item, item.type, null, switch.checked)"></Switch>
<DropDown #aa
*ngIf="item.type=='select'"
row="1"
[items]="categoryService.showAttributeValues(item.value)"
[selectedIndex]="selectedIndex"
(selectedIndexChange)="categoryService.onAttributeChange(item, item.type, aa.selectedIndex)"></DropDown>
</GridLayout>
</template>
</ListView>
</StackLayout>
Спасибо!
TextField
в ListView уже исправлена и будет доступна в NS 2.4 - проблема github.com/NativeScript/NativeScript/issues/2942 - person Nikolay Tsonev   schedule 03.11.2016