Simple usage analysis of Android viewflipper

Viewflipper and viewpager are very similar. They are both a view container. Multiple views can be added internally, but the viewpager can switch views by sliding left and right, while the viewflipper does not have this function, so you need to monitor gestures on it. The more convenient thing is that it can add views without using adapters, so it is more convenient.

First define this control in the layout file:

2. Find and add view in the code

3. Use touch to monitor gestures to switch views

Here is the complete code of the activity:

Animation file:

push_ left_ in. xml

push_ left_ out. xml

push_ right_ in. xml

push_ right_ out. xml

Source code download: http://xiazai.jb51.net/201609/yuanma/AndroidViewFlip (jb51.net). rar

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