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知识,便可以轻松快速 ...
随机推荐
- unittest单元测试框架之测试环境的初始化与还原(fixture)(五)
1.方法一:针对每条测试用例进行初始化与还原 import unittest from UnittestDemo.mathfunc import * class TestMathFunc(unitte ...
- 系统优化怎么做-SQL优化
大家好,这里是「聊聊系统优化 」,并在下列地址同步更新 博客园:http://www.cnblogs.com/changsong/ 知乎专栏:https://zhuanlan.zhihu.com/yo ...
- MyBatis之properties配置
这些属性都是可外部配置且可动态替换的,既可以在典型的 Java 属性文件中配置,亦可通过 properties 元素的子元素来传递.例如: <properties resource=" ...
- windows下3D文字
windows下3D文字 简单概述 需要在每一帧的视频图像上面添加3D文字,文字可以自由移动位置,变换各种字体属性,还能进行一些简单动画.然后把处理好的视频图像传个下一个步骤去处理.做的过程中参考了G ...
- 【centOS7.3 彻底卸载MySQL】
废话不多说,直接正面刚. 1.删除MySQL yum remove mysql mysql-server mysql-libs mysql-server; 执行后继续查找相关文件 find / -na ...
- chromium之ref_counted
namespace subtle { class RefCountedBase { protected: RefCountedBase(); ~RefCountedBase(); void AddRe ...
- ComboBox可搜索下拉框的使用注意事项,简单记录以及我遇到的一些奇怪的bug
前几天做一个react的项目的时候需要用一个可搜索的下拉框ComboBox,上代码: <ComboBox // className={comboxClassName} items={storeA ...
- npm安装包时 --save 和 --save-dev 的区别
以npm 安装 vue为例 1.npm install vue: 会把vue包安装到node_modules目录中: 不会修改package.json文件: 之后运行npm install命令时,不会 ...
- 第3章 jQuery中的DOM操作
parent() .parents().closest() 区别示例: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiona ...
- Vue directive自定义指令+canvas实现H5图片压缩上传-Base64格式
前言 最近优化项目-手机拍照图片太大,回显速度比较慢,使用了vue的自定义指令实现H5压缩上传base64格式的图片 canvas自定义指令 Vue.directive("canvas&qu ...