Question

I am new to ViewPagerIndicator. I am using LineIndicator along with my ViewPager. The default look is tiny blue lines wherever you position them.

However, if I want to, say, change the color and the width and height, how would I do that?

Update
If you look at the sample phones shown, the one in the center has red lines at the bottom. The title of the app says "Line / Styled (via layout)". That is what I am trying to achieve.

Was it helpful?

Solution

You just need to style your LinePageIndicator in your .xml layout file.

EX:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        />
    <com.viewpagerindicator.LinePageIndicator
        android:id="@+id/indicator"
        android:padding="5dip"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        app:strokeWidth="4dp"
        app:lineWidth="30dp"
        app:unselectedColor="#FF888888"
        app:selectedColor="#FF880000"
        />

</LinearLayout>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top