Viewpager set the number of caches, page spacing, data updates

Source: Internet
Author: User

When using Viewpager common settings

1) mviewpager.setoffscreenpagelimit (2);//Set the number of cached view (actual 3, cache 2 + 1 being displayed)
2) Mviewpager.setpagemargin ((int) getresources (). Getdimensionpixeloffset (R.dimen.ui_5_dip));//Set Viewpager spacing per page card , similar to the Spacing property of gallery

3) Viewpager Update data problem:

The direct use of notifydatasetchanged is not updatable, and it is necessary to override GetItemPosition return constant Position_none (this constant is Viewpager band).

This article transferred from: http://blog.csdn.net/jia4525036/article/details/18982197

Viewpager set the number of caches, page spacing, data updates

Related Article

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.