首页 文章

多选角度nativescript

提问于
浏览
0

我需要为我的nativescript角度应用程序构建一个多项目选择UI元素 . 似乎没有支持多选的nativescript UI组件 . 有关如何为我的应用实现此功能的任何示例?

1 回答

  • 3

    使用Nativescript UI . 列表视图和侧面抽屉是免费的 .

    http://docs.telerik.com/devtools/nativescript-ui/Controls/Angular/ListView/selection

    multiple selection - 允许选择多个项目 . RadListView跟踪选择的项目并通过getSelectedItems()方法公开它们 . 通过将multipleSelection属性设置为true,可以启用多个选择 .

    <RadListView [items]="dataItems" selectionBehavior="Press" multipleSelection="true">
        <!-- << angular-listview-item-selection-multiple -->
            <template tkListItemTemplate let-item="item">
                <StackLayout class="listItemStackLayout">
                    <Label class="nameLabel" [text]="item.name"></Label>
                    <Label class="descriptionLabel" [text]="item.description"></Label>
                </StackLayout>
            </template>
            <ListViewLinearLayout tkListViewLayout itemHeight="50" scrollDirection="Vertical"></ListViewLinearLayout>
    </RadListView>
    

    随着UI试用版下载,还有一个演示示例 . 玩那个 .

相关问题