【问题标题】:multiple select angular nativescript多选角原生脚本
【发布时间】:2017-03-11 05:14:51
【问题描述】:

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

【问题讨论】:

    标签: angular nativescript angular2-nativescript


    【解决方案1】:

    使用 Nativescript 用户界面。列表视图和侧边抽屉是免费的。

    http://docs.telerik.com/devtools/nativescript-ui/Controls/Angular/ListView/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 试用下载,还有一个演示示例。玩那个。

    【讨论】:

    • 感谢组件完成这项工作!
    猜你喜欢
    • 2017-05-27
    • 2020-07-03
    • 1970-01-01
    • 2016-06-08
    • 2023-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-05
    相关资源
    最近更新 更多