Ionic2 create app startup page and slide the welcome interface left and right

Summary: @ h_ 403_ 1@

Each compelling app has a welcome interface when it is first started, usually several single pages or single pages with animation. There is a start button when it slides to the last page. This article will use ionic2 to create it, so easy@ H_ 403_ 1@

The effect is as follows @ h_ 403_ 1@

@H_ 403_ 1@@H_ 403_ 1@

This example is slightly different from the above figure. The main functions are as follows: @ h_ 403_ 1@

Each slide shows a full screen picture@ H_ 403_ 1@

Slide to the last page before the start button appears@ H_ 403_ 1@

The welcome screen only appears when the first installation starts@ H_ 403_ 1@

Let's realize this function step by step: @ h_ 403_ 1@

1. Create application: @ h_ 403_ 1@

Using ionic2 to create an application is very simple. Just follow the V1 command with -- V2, as follows: @ h_ 403_ 1@

2. Create Component@H_403_1 @

Use the command line to create a page or create the file @ h yourself_ 403_ 1@

Then open the application and component app component. TS, import component, app module. TS is the same and configure @ H_ 403_ 1@

3. Create the template file welcome html@H_403_1 @

You can easily create a welcome page @ h through ionic's own ion slides_ 403_ 1@

4. Create welcome scss@H_403_1 @

5. Create welcome ts@H_403_1 @

6. Import the welcome component in the root component and edit the app moudle. ts@H_403_1 @

Here, it is judged whether the app is started for the first time. The native storage component is used. A storage variable firstin will be written in the first startup. If this variable is read in the next startup, the welcome page will be skipped directly. Note that ionic2 starts storage by default using indexeddb instead of LocalStorage@H_403_1 @

The above is what Xiaobian introduced to you. Ionic2 creates an app launch page and slides the welcome interface left and right. I hope it will help you. If you have any questions, please leave me a message and Xiaobian will reply to you in time@ H_ 403_ 1@

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>