How to use Android pageradapter

Source: Internet
Author: User

Turn http://blog.csdn.net/look85/article/details/8563906

Before writing this, really need to spit groove ... About Android Development, the use of pageadapter can be found on the internet really little to no, this is the first encounter, in the attempt to all kinds of Baidu, all kinds of Google without fruit. I'm starting to wonder if it's what I think. This problem is too superficial, in the eyes of others is not a problem pinch, others are a glance can know how to use the drip? .... Depressed to death ... Helpless can only open the help document of the Android SDK, by the way open Youdao, find PageAdapter class, God ... All English documents for a person who is not good at English, this is how tragic it is .... Looked at an afternoon of the help document, so have the following about PageAdapter understanding, English is not good, wrong really don't blame me, someone understand also hope to share ... Thx!!!

Pageradapter usage

PageAdapter is an abstract class that inherits directly from object and is imported into the package Android.support.v4.view.PagerAdapter to be used.

The original description of Pageaapter is this: Base class providing the adapter to populate pages inside of a viewpager. You'll most likely want to use a more specific implementation of this, such as Fragmentpageradapter or fragmentstatepage Radapter.

In fact, Pageradapter is an adapter provided by Viewpager, which allows us to control each view. What is that Viewpager? It is the realization of the left and right two screens smoothly to switch a class, specific Baidu Google ... There are many ways to use Viewpager.

To use Pageradapter, first inherit the Pageradapter class, and then at least overwrite the following method Instantiateitem (viewgroup, int)/** This method, return an object, This object indicates which object the Pageradapter adapter chooses to place in the current Viewpager **/destroyitem (viewgroup, int, Object)/** This method, which removes the current ViewGroup from the view** /GetCount ()/** This method, is to get the current form interface number **/Isviewfromobject (View, Object)/** This method, in the text of the help document is could be implemented as return View = = Object,* is also used to determine whether the interface is generated by an object **/

How to use Android pageradapter

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.