ionic LoadingController 模块使用
html 代码: <ion-header> <ion-navbar>
<ion-title>Loading</ion-title>
</ion-navbar> </ion-header> <ion-content class="outer-content"> <ion-list>
<ion-list-header>
Spinner Loading Indicators
</ion-list-header>
<button ion-item (click)="presentLoadingIos()">
<ion-spinner item-start name="ios"></ion-spinner>
Show iOS
</button>
<button ion-item (click)="presentLoadingDots()">
<ion-spinner item-start name="dots"></ion-spinner>
Show Dots
</button>
<button ion-item (click)="presentLoadingBubbles()">
<ion-spinner item-start name="bubbles"></ion-spinner>
Show Bubbles
</button>
<button ion-item (click)="presentLoadingCircles()">
<ion-spinner item-start name="circles"></ion-spinner>
Show Circles
</button>
<button ion-item (click)="presentLoadingCrescent()">
<ion-spinner item-start name="crescent"></ion-spinner>
Show Crescent
</button>
<button ion-item (click)="presentLoadingDefault()">
<ion-spinner item-start></ion-spinner>
Show Default
</button>
</ion-list> <ion-list>
<ion-list-header>
Custom Loading Indicators
</ion-list-header>
<button ion-item (click)="presentLoadingCustom()">
Show Custom
</button>
<button ion-item (click)="presentLoadingText()">
Show Text Only
</button>
</ion-list> </ion-content> <ion-footer> <ion-toolbar>
<ion-buttons end>
<button ion-button icon-end (click)="goToPage2()">
Show Loading and Navigate
<ion-icon name="arrow-forward"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar> </ion-footer>
.ts 文件:
import { Component } from '@angular/core';
import { LoadingController, NavController } from '../../../../../src';
import { PageTwo } from '../page-two/page-two';
@Component({
templateUrl: 'page-one.html'
})
export class PageOne {
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoadingIos() {
let loading = this.loadingCtrl.create({
spinner: 'ios',
content: 'This is the "ios" spinner. It will dismiss after 3 seconds.',
duration: 3000
});
loading.present();
}
presentLoadingDots() {
let loading = this.loadingCtrl.create({
spinner: 'dots',
content: 'This is the "dots" spinner. It will dismiss after 3 seconds.',
duration: 3000
});
loading.present();
}
presentLoadingBubbles() {
let loading = this.loadingCtrl.create({
spinner: 'bubbles',
content: 'This is the "bubbles" spinner. It will dismiss after 3 seconds.',
duration: 3000
});
loading.present();
}
presentLoadingCircles() {
let loading = this.loadingCtrl.create({
spinner: 'circles',
content: 'This is the "circles" spinner. It will dismiss after 3 seconds.',
duration: 3000
});
loading.present();
}
presentLoadingCrescent() {
let loading = this.loadingCtrl.create({
spinner: 'crescent',
content: 'This is the "crescent" spinner. It will dismiss after 3 seconds.',
duration: 3000
});
loading.present();
}
presentLoadingDefault() {
let loading = this.loadingCtrl.create({
content: 'This is the mode specific spinner. It will dismiss after 3 seconds.',
duration: 3000
});
loading.present();
}
presentLoadingCustom() {
let loading = this.loadingCtrl.create({
spinner: 'hide',
content: `
<div class="loading-custom-spinner-container">
<div class="loading-custom-spinner-box"></div>
</div>
<div>This is a custom spinner. It will dismiss after 3 seconds.</div>`,
duration: 3000
});
loading.present();
}
presentLoadingText() {
let loading = this.loadingCtrl.create({
spinner: 'hide',
content: 'This has no spinner, only text. It will dismiss after 3 seconds.',
duration: 3000
});
loading.present();
}
goToPage2() {
let loading = this.loadingCtrl.create({
content: 'This will navigate to the next page and then dismiss after 3 seconds.'
});
loading.present();
setTimeout(() => {
this.navCtrl.push(PageTwo);
}, 1000);
setTimeout(() => {
loading.dismiss();
}, 4000);
}
}
ionic LoadingController 模块使用的更多相关文章
- ionic 2,带着运气成分
npm config set loglevel info 查看安装信息 npm cache clean 清除缓存 cnpm sync ionic ...
- ionic4 混合移动开发 (前世今生)
ionic 从2016年初识,经历了 ionic2 ionic3.至今 ionic4,终于在2018年7月份发布了测试版. ionic Framework 可以说得上是最接近原生app的ui组件,漂亮 ...
- [ionic开源项目教程] - 第13讲 Service层优化,提取公用Service,以及生活和农业两大模块的实现
关注微信订阅号:TongeBlog,可查看[ionic开源项目]全套教程. 这一讲主要实现生活和农业两大模块的实现,在这个过程中,对service层提取出一个公用的BaseService. 这一讲分为 ...
- [ionic开源项目教程] - 第12讲 医疗模块的实现以及Service层loadMore和doRefresh的提取封装
关注微信订阅号:TongeBlog,可查看[ionic开源项目]全套教程. 这一讲主要实现tab2[医疗]模块,[医疗]模块跟tab1[健康]模块类似. [ionic开源项目教程] - 第12讲 医疗 ...
- npm 安装卸载模块 & ionic插件安装与卸载
npm安装模块 npm install xxx利用 npm 安装xxx模块到当前命令行所在目录 npm install -g xxx利用npm安装全局模块xxx 本地安装时将模块写入package.j ...
- ionic 获取手机所在位置
之前项目中需要使用到定位功能,前边的文章提到的坐标位置是有问题的,是国际坐标,国内的环境使用google地图会出现问题,所以需要使用国内的地图进行坐标解析,因为国内和国外的坐标体系不一致,需要通过转换 ...
- Ionic中使用Chart.js进行图表展示以及在iOS/Android中的性能差异
Angular Chart 简介 在之前的文章中介绍了使用 Ionic 开发跨平台(iOS & Android)应用中遇到的一些问题的解决方案. 在更新0.1.3版本的过程中遇到了需要使用图表 ...
- ionic 踩过的坑
内联模板 : script可能你没有注意过,HTML中常用的script标签在AngularJS中被重新定义了: 除了原来的脚本声明功能之外,如果script元素的type属性 定义为text/ng- ...
- phongap、APICloud、ionic等app开发平台你都知道吗?
大众创业热,很多人都想在互联网大展拳脚,然而大部分人却是非技术背景.针对这个行业痛点,现在国内外涌现出众多APP开发工具,开发者只要有相关的HTML5.CSS和JavaScript知识,便可以轻松快速 ...
随机推荐
- Gradle Goodness: Init Script for Adding Extra Plugins to Existing Projects
Gradle Goodness: Init Script for Adding Extra Plugins to Existing Projects Gradle is very flexible. ...
- 1.Redis介绍以及安装
Redis介绍 Redis是一个开源的(BSD开源协议),内存数据结构存储,被用于作为数据库,缓存和消息代理. Redis支持如下数据结构: string(字符串) hashes(哈希) lists ...
- 类似"音速启动"的原创工具简码"万能助手"在线用户数终于突破100了!
原本只是开发出来方便自己的一个小工具,看到群友也喜欢,就随手分享了, 经过1个多月的自然积累,在线用户数终于突破100了,这增长速度实在让人泪奔~ 博客园的朋友如果看到,喜欢的话就拿去用吧, 万能助手 ...
- 解决vue变量未渲染前代码显示问题
在网络加载缓慢或者刷新的时候总会有那么一瞬间出现vue的模板代码,实在很影响美观,对于我这种有强迫症的人来说实在是忍无可忍,后来经过查找资料,终于发现了解决方法,可以使用vue现成的指令来解决这个问题 ...
- ie 兼容
ese,promise解决text/babel <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7 ...
- 自动曝光修复算法 附完整C代码
众所周知, 图像方面的3A算法有: AF自动对焦(Automatic Focus)自动对焦即调节摄像头焦距自动得到清晰的图像的过程 AE自动曝光(Automatic Exposure)自动曝光的是为了 ...
- es6 Reflect对象详解
Reflect是ES6为操作对象而提供的新API,而这个API设计的目的只要有: 将Object对象的一些属于语言内部的方法放到Reflect对象上,从Reflect上能拿到语言内部的方法.如:Obj ...
- 帝国cms全文搜索 增加自定义字段搜索
帝国cms全站搜索功能只能调出固定的几个字段,如果想搜索其他字段的值,这时我们应该怎么办呢?开拓族网站有这个需求,所以研究了一下帝国的全站搜索,后来发现在/e/sch/index.php中可以直接对数 ...
- delphi 2010以上 安装 第三方控件
delphi-“can't be installed because it is not a design time package. 一定要先装 dcl*.dpk ----------------- ...
- C语言调整数组使奇数全部都位于偶数前面
//输入一个整数数组,实现一个函数,//来调整该数组中数字的顺序使得数组中所有的奇数 位于数组的前半部分,//所有偶数 位于数组的后半部分. #include<stdio.h>#inclu ...