0

In my app, I am trying to style ViewPagerIndicator. The pager consists of several fragments. I want something exactly like the picture attached - the CirclePageIndicator at the bottom right & a title at the bottom left. However, the CirclePageIndicator is positioned centered by default & if I customize indicator's "centered" value false, then it goes to the left. I haven't found any option to move that to the right side as shown in the picture.

Fragments in ViewPager with ViewPagerIndicator

Another concern is the title of the pager. I have tried with PagerTitleStrip but this is not actually what I am looking for, this PagerTitleStrip shows the previous & next page's title at the left & right side of the title, but I want only this page's title - exactly in the same format like the picture.

BTW, I am using Jake Wharton's library for the ViewpagerIndicator.

I am stuck in this issue for several days. I hope someone comes out with his wise thinking & helps me out of this?

Regards. & Thanks in advance.

4

1 回答 1

2

在 src/com/viewpagerindicator/CirclePageIndicator.java

添加这个

//在第 236 行

    if (mRight) {
        longOffset = longSize  - ((count * threeRadius) / 2.0f);
    }

//大约在第 116 行

public void setRight(boolean right) {
    mRight = right;
    invalidate();
}

//第 58 行

private boolean mRight; 

如果需要,您还可以添加一些填充

于 2013-03-27T11:08:25.293 回答