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知识,便可以轻松快速 ...
随机推荐
- HTML&CSS 问题
1.子div使用浮动,父div高度自适应(个人感觉好用) 方法: css: <style> .clear{ clear:both} </style> html:在父div关闭之 ...
- 史上最简单的SpringCloud教程 | 第九篇: 服务链路追踪(Spring Cloud Sleuth)(Finchley版本)
转载请标明出处: 原文首发于:>https://www.fangzhipeng.com/springcloud/2018/08/30/sc-f9-sleuth/ 本文出自方志朋的博客 这篇文章主 ...
- iOS读取info.plist中的值
在app运行的时候,需要读取info.plist中的信息,用以下代码可获取整个info.plist的信息 [[NSBundle mainBundle] infoDictionary] 以下为根据 ke ...
- 通过ES6写法去对Redux部分源码解读
在Redux源码中主要有四个文件createStore,applyMiddleware,bindActionCreators,combineRedures createStore.js export ...
- C++ map练习
C++ STL之map map介绍 C++里的map数据结构,会存储键值对信息key-value,通过key得到value的信息.map的key与value有一个特点就是:每个唯一的key拥有唯一对应 ...
- Python实现音乐的剪辑
一.读取音频文件 from scipy.io import wavfile import numpy as np like = wavfile.read('./嘤嘤嘤.wav') print (lik ...
- [转]Javascript removeChild()删除节点及删除子节点的方法(同样适用于jq)
Javascript removeChild()删除节点及删除子节点的方法 这篇文章主要介绍了Javascript removeChild()删除节点及删除子节点的方法的相关资料,需要的朋友可以参考下 ...
- 帝国cms伪静态设置方法(收藏)
众所周知,动态页面不利于收录和排名.伪静态可以完美的解决这问题,配合百度云加速CDN,可以让动态页面有静态页面一样快的访问速度. 今天开拓族给大家带来帝国CMS伪静态的详细设置方法. 1.栏目设置为动 ...
- mysql 导出行数据到txt文件,指定字符分割
select id,name, concat('tel:',phone) from user order by time INTO outfile 'user.txt' FIELDS terminat ...
- 关于python的菜鸟教程
1.正则表达式 http://www.runoob.com/regexp/regexp-metachar.html 2.python正则表达死 http://www.runoob.com/python ...