Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

默认显示第几个怎么设置啊。 #1

Open
ZhetengDashen opened this issue Oct 13, 2016 · 1 comment
Open

默认显示第几个怎么设置啊。 #1

ZhetengDashen opened this issue Oct 13, 2016 · 1 comment

Comments

@ZhetengDashen
Copy link

我设置 viewPager.setCurrentItem(3); Fragment切换到了对应的 。 但是下面的Indicator 没有切换过去。改怎么弄一下嘞??

@wuyinlei
Copy link

可以在AlphaIndicator里面定义一个方法,这个变量是已经定义好的

    /**
     * 添加设置默认第几页的
     * @param currentItem  当前要显示的item
     */
    public void setCurrentItem(int currentItem) {
        this.currentItem = currentItem;
    }

然后在你使用的activity里面,

 viewPager.setCurrentItem(3);
 alphaIndicator.setCurrentItem(3);

同时调用这两个方法,切记,是一起调用,填写的int是一致的。就可以实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants