nativeScript-nbmaterial-pullrefresh
NativeScript 实现下拉刷新(两个方向 => 顶部和底部)。适用于 iOS 和 Android 平台。
npm i --save nativescript-nbmaterial-pullrefresh
- 版本:1.0.0
- GitHub:
- NPM: https://npmjs.net.cn/package/nativescript-nbmaterial-pullrefresh
- 下载量
- 昨日: 0
- 上周: 0
- 上个月: 0
NativeScript 实现PullToRefresh行为
该模块在 iOS 和 Android 两个平台上实现了 Material 日期选择器。支持两个方向(顶部和底部)的刷新。要使用 pulltorefresh 组件,您必须使用 recycler 包。
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:ti="nativescript-nbmaterial-pullrefresh" xmlns:pullr="nativescript-nbmaterial-pullrefresh">
<pullr:PullToRefresh direction="both" id="pullrefresh">
<rec:RecyclerView row="0" items="{{source}}" id="list" itemTap="tapItem" itemLongTap="tapLongItem" itemTemplateSelector="templateSelector">
<rec:RecyclerView.itemTemplates>
<template key="zero">
<Label text="{{ text }}" backgroundColor="green" />
</template>
<template key="un">
<Label text="{{ text }}" backgroundColor="white" paddingTop="10" paddingBottom="10" />
</template>
<template key="deux">
<Label text="{{ text }}" backgroundColor="red"/>
</template>
</rec:RecyclerView.itemTemplates>
</rec:RecyclerView>
</pullr:PullToRefresh>
</Page>
}
PullToRefresh 拥有此接口
export declare class PullToRefresh extends View {
direction: "both" | "bottom" | "top";
public static refreshTopEvent;
public static refreshBottomEvent;
public androidBottomRefreshView: ActivityIndicator;
startRefreshTop();
startRefreshBottom();
stopRefreshTop();
stopRefreshBottom();
}