Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an overlay page in ionic 2?

How to creating an transparent guide overlay page when i enter into new page

How can i implement in ionic 2 ?

enter image description here

like image 865
sridharan Avatar asked Aug 30 '16 07:08

sridharan


People also ask

What is lazy loading Ionic?

What is Lazy Loading? Lazy Loading is a process of loading only those components which are required for the current view. Applications using Lazy Load do not load all components at once so at initialization only one component of root page will be loaded, this really improves the loading time of ionic applications.


1 Answers

You can just create div outside the <ion-content>:

<div class="my-overlay" padding [hidden]="overlayHidden">
    <button full (click)="hideOverlay()">Click me</button>
</div>

with 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;

and (after constructor):

public hideOverlay() {
    this.overlayHidden = true;
}
like image 177
edi_smooth Avatar answered Sep 30 '22 05:09

edi_smooth