如何在离子2中创建叠加页面? [英] How to create an overlay page in ionic 2?
本文介绍了如何在离子2中创建叠加页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我进入新页面时如何创建透明指南覆盖页
How to creating an transparent guide overlay page when i enter into new page
我如何在离子2中实现?
How can i implement in ionic 2 ?
推荐答案
您可以在<$外创建div c $ c>< ion-content> :
<div class="my-overlay" padding [hidden]="overlayHidden">
<button full (click)="hideOverlay()">Click me</button>
</div>
CSS:
.my-overlay {
position: fixed;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.7);
z-index: 20;
top: 0;
left: 0;
}
在类声明中添加(在构造函数之前):
In class declaration add (before constructor):
overlayHidden: boolean = false;
和(构造函数后):
public hideOverlay() {
this.overlayHidden = true;
}
这篇关于如何在离子2中创建叠加页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文