3
Dans mon application NativeScript, il y a un ListView. En js ajouter de nouveaux objets et la hauteur ne change pas. Comment changer la hauteur Ajustement ListView des enfants?ListView and Height
XML:
<ListView id="incomeList" items="{{ income }}" row="1" itemTap="">
<ListView.itemTemplate>
<StackLayout orientation="horizontal" cssClass="shares-item">
<GridLayout columns="*, *, auto">
<TextField text="{{ userId }}" cssClass="shares-item-label" col="0" keyboardType="number" />
<TextField text="{{ cost }}" cssClass="shares-item-label" col="1" keyboardType="number"/>
<Image ind="{{ ind }}" tap="removeIncomeElement" src="~/img/ic_close.png" col="2"/>
</GridLayout>
</StackLayout>
</ListView.itemTemplate>
</ListView>
JS:
var incomeItems = new observableArray.ObservableArray();
function pageLoaded(args) {
page = args.object;
incomeList = view.getViewById(page, "incomeList");
}
function addIncome(args) {
newItem = new observable.Observable({userId: 0, cost: 0, summ: 0, ind: incomeIndex});
incomeItems.push(newItem);
incomeList.items = incomeItems;
}
Avez-vous trouvé une solution à ce problème? – Kansen