New possibilities for dynamically loading data

Source: Internet
Author: User

Loading data dynamically is a way to load data as the user interacts, avoiding a full load of wasted traffic and stalling.

The most typical scenario is when the user views the information of the day.

The first thing I did was to use a scrollview and a three view to solve the problem. First implement a Carousel chart effect, each time the user left and right slide after the page jumps back to the middle of the page, this time the status of the middle page should be the same as the left or right slide the state of the page. So each time you load the left and right three days of data, swipe to the right, reset the three-day data jump to the middle.

But this has a problem, it is difficult to achieve bounce rebound effect, even if the code will be very messy, there is a rapid sliding when the problem caused by the inability to slide.

Later the practice is to use the Uicollectionview, the advantage is that data management is already encapsulated, and the reuse mechanism is very powerful, the bad place is every time the cell is sliding to refresh, if this is the time to interact, it is easy to cause the Dayton.

Another way is to use ScrollView, each time the sliding load a number of views on the top, the advantage is that the refreshed page is no longer the user click on the page, can solve the problem of possible lag, the bad thing is that if the user swipe too much of the words will be very memory consumption.

According to the present situation, the third way seems to be the best.

New possibilities for dynamically loading data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.