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知识,便可以轻松快速 ...
随机推荐
- 【Javascript-ECMA6-Fetch详解】
Fetch 由于Fetch API是基于Promise设计,因此旧的浏览器并不支持该API,需要引用时引用es6-promise. 基本知识 fetch请求返回response格式 body Fetc ...
- MVC进行多文件上传
用mvc做多文件的上传和保存到本地,大致流程就是,前台通过form表单提交多文件,Controller接受到文件流,将文件流保存到本地 然后将保存地址 存到数据库中. 将文件通过from提交 < ...
- Qt5连接Mysql环境配置
已安装的环境:Mysql5.7 64bit ,Qt5.12 64bit. 到mysql官方下载mysql5.7 64bit的压缩包,解压,复制下图框内四个文件. 将四个文件复制到Qt安装目录下bin目 ...
- python环境Anaconda的安装
本人最开始的的环境为:win10 + 32位的python 最近想学习一下爬虫,听说某些库需要64的python才能实现(本人也是小白,只是平时喜欢折腾,这里是听说,暂时没有能力解释),无奈之下只好卸 ...
- JS this总结
JS中一切皆对象,this关键字出现在对象定义时的成员(属性和方法)里,因此this指向的是一个JS对象,这个JS对象具体是哪一个的确定是在运行时确定的. 非严格模式: 1.作为对象成员:对象调用对象 ...
- laravel 安装添加多站点
官方文档如下 https://learnku.com/laravel/t/1160/laravel-nginx-multi-site-configuration
- 01 elasticsearch 概念理解
最近在看一套 es 的教学视频,以下笔记主要来自视频资源 Near Realtime(NRT):近实时,先说实时就是数据创建到查询时间在毫秒级或更少: 和实时不一样的是近实时数据在创建到查询最多需要n ...
- Go语言中的流程控制
1 概述 Go语言提供了条件分支 if,状态分支 switch,循环 for,跳转 goto,延迟执行 defer,这些流程控制语句.分别作说明如下: 2 条件分支 if 依据条件是否满足确定执行哪个 ...
- Prim算法堆优化
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> ...
- JavaWeb——库存管理系统(1)jsp部分---18.12.13
add.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pa ...