离子等待GIF结束,然后更改视图

时间:2018-08-28 17:44:35

标签: ionic-framework wait gif

我有一个问题,在我的应用程序上,当用户单击按钮并在动画结束后更改视图时,必须以GIF格式显示给我的动画。

TS逃跑:

export class AreYouReadyPage {
    private src = 'assets/gif/waiting.gif';

    constructor(public navCtrl: NavController, public navParams: NavParams) {
    }

    ionViewDidLoad() {
    }

    noOption() {
        this.navCtrl.pop();
    }

    yesOption() {
        this.src = 'assets/gif/zucchini-omelet.gif';
        // wait 1 second
        this.navCtrl.push(StepPage, {steps: this.navParams.get('steps')})
    }
}

HTML文件:

<ion-row>
    <span (click)="yesOption()" class="option-button yes-option">
        <img src="assets/icon/check.png">
    </span>

    <span (click)="noOption()" class="option-button no-option">
        <img src="assets/icon/wrong.png">
    </span>
</ion-row>

<img src="{{src}}" class="celia">

<back-button></back-button>

0 个答案:

没有答案