Image view reuse in iOS development enables unlimited image carousel,
In the previous blog, the seamless scrolling component encapsulation and use of many images developed by iOS provides one of the Implementation Solutions for Infinite Image carousel. The following is another solution. What I want to talk about in my blog today is to paste two imageviews ON THE ScrollView, and switch the ImageView to achieve unlimited Carousel of the image, and modify the image on the ImageView during carousel. In the previous blog, several images are instantiated and then pasted to the corresponding ImageView in advance. This method is simple and easy to implement.
Today, this blog will use two imageviews to display images in an alternate area. The Image will be pasted to the ImageView only when it is to be displayed. This blog will focus on the topic of today's blog.
I. Analysis of operation results and principles
1. Demo Running Effect
The Gif is the running effect of the blog Demo. However, the running effect is the same as that of the previous blog, but the essence and implementation principle are different. At the end of this blog, we will provide the Demo sharing address on Github. First of all, you can check the effect. It can be played infinitely and can be moved manually. When you click an image, Block callback is used to index the image.
Ii. demo sharing
As for the code of this blog, I did not paste a line of code to the blog. The principle is clear and the implementation should not be a problem. The code of this blog will be shared on github, below is the github sharing address. If you are interested, you can Clone it.
GitHub address: https://github.com/lizelu/ZLImageScrollView
The following blogs will share some SQLite things with you, so you can get a deeper look at the SQLite database ~