Android realizes page sliding switching animation

This example shares the specific code for Android to realize page sliding switching animation for your reference. The specific contents are as follows

Realize the sliding switching between two pages, and the effect of some albums is the same

An activity interface configuration file

activity_ main.xml:

MainActivity.java:

There is an enter in the RES / anim / folder_ Lefttoright.xml and enter_ righttoleft.xml out_ Lefttoright.xml and out_ righttoleft.xml

Four animation profiles:

enter_ lefttoright.xml:

enter_ righttoleft.xml:

out_ lefttoright.xml:

out_ righttoleft.xml:

Effect: slide right by hand, the whole page slides right slowly, switch pages, slide left by hand, the whole page slides left slowly, switch pages. (you can also change the configuration file to other animation effects. This example uses the animation effects of moving in and out)

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

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
分享
二维码
< <上一篇
下一篇>>