vue.js - 如何在 NativeScript/Vue 中自定义 Pull-To-Refresh 指示器样式?
问题描述
我正在尝试在 NativeScript/Vue 应用程序中自定义 Pull-To-Refresh 指示器的样式。Vue 似乎没有示例代码。我尝试将以下从 Angular 改编的代码放入,运行应用程序时出错。
<RadListView.pullToRefreshStyle>
<PullToRefreshStyle indicatorColor="white" indicatorBackgroundColor="blue"/>
</RadListView.pullToRefreshStyle>
任何人都可以提供一个工作示例或更新以下页面吗? https://docs.nativescript.org/vuejs/ns-ui/ListView/pull-to-refresh
另一方面,根据此处的文档: https ://docs.nativescript.org/ns-ui-api-reference/classes/pullorefreshstyle
只能自定义颜色和背景颜色。有没有办法绕过指标的这种变化大小?
我能想到的唯一方法是将指标的前景和背景都设置为透明,然后使用页面级别的activityIndicator。
解决方案
只需在属性上设置pullToRefreshStyle
属性
HTML
<RadListView :pullToRefreshStyle="pullToRefreshStyle">
脚本
import * as colorModule from "tns-core-modules/color";
data() {
return {
pullToRefreshStyle: {
indicatorColor: new colorModule.Color("red"),
indicatorBackgroundColor: new colorModule.Color("green")
}
};
}
推荐阅读
- python - 基于用户输入的动态 if 语句
- tensorflow - Tensorflow 模型 - 对象检测如何指定时期详细信息?
- ms-access-2010 - MS Access,如何检测触发器宏中的新插入与更新?
- jquery - 如何使用 Velocity.js 平滑滚动到元素?
- algorithm - 如何对渐近符号函数集进行操作,即。大O+大欧米茄?
- ocaml - Bs.deriving Abstract getter 函数在使用大写名称时返回 undefined
- git - 使用`git commit -a`时找出git`pre-commit`钩子中的暂存文件
- c# - 按键事件陷入无限循环
- javascript - VichUploader 和 CroppieJS:如何发送 base64 裁剪图像以保留在 Symfony 4 中
- android - 如何从 Android Native 应用程序设置线程堆栈大小?