Android uses viewpager to realize the effect of rotating picture

Writing this article is just to deepen the impression of what we have learned today and deal with viewpager, such as the role of adapters and various methods.

Look at the renderings first

Here I write dots in XML

XML code under drawable folder:

Shape_ yes.xml:

Shape_ no.xml:

selector

Activity_ main.xml:

Write a class viewpageradapter_ Circleextends PagerAdapter

Code in mainactivity (including comments)

The above is what Xiaobian introduced to you. Android uses viewpager to achieve the effect of rotating pictures. I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

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