How to use viewpagerindicator with ViewPager in Android?
Solution 1
You could use the new android PagerTabStrip, it works very nice and is backwards compatible. Here is a nice example project, using the android PagerTabStrip:
http://code.google.com/p/viewpage-title-project/
http://developer.android.com/reference/android/support/v4/view/PagerTabStrip.html
The only thing you need to do is importing the android support library version 9:
Right click your project --> android tools --> add support library.
Solution 2
- Download the source code of that project
- In your Eclipse workspace: File > New > Project... > Android > Android project from existing code
- As the location choose viewpagerindicator/library (this should create the library project in your workspace)
- Right click on your project > Properties...
- Android > Library > Add...
- Select the viewpagerindicator project you have created with previous steps.
- Follow the instructions about how to include a view pager indicator in your layouts as on http://viewpagerindicator.com/#usage
![Jainendra](https://i.stack.imgur.com/k0baK.jpg?s=256&g=1)
Comments
-
Jainendra almost 2 years
I want to use viewpagerindicator with
ViewPager
in my android application. I've createdViewPager
, now I want to display the title of each page in theViewPager
. After reading this I came to know that viewpagerindicator will be helpful. Now the problem is that how can I use this project in my project. I tried adding fromproperties --> java build path --> Libraries --> add external class folders
but it doesn't helped.
I also tried to compile the libraries downloaded from http://viewpagerindicator.com/, but that gives me a bunch ofThe method setViewPager(ViewPager) of type LinePageIndicator must override a superclass method
type errors.I want to use
TabPageIndicator
andTitlePageIndicator
from viewpagerindicator project in my application as described here. -
Jainendra over 11 yearsI tried this but this gives me a bunch of
the method setViewPager(ViewPager) of type LinePageIndicator must override a superclass method
type errors in the library project. -
Vincent Mimoun-Prat over 11 years