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

第一个图标默认选中时,并没有正确显示选中的图标,而是显示的未选中的图标 #34

Open
ziKunLi opened this issue Sep 13, 2019 · 2 comments

Comments

@ziKunLi
Copy link

ziKunLi commented Sep 13, 2019

调用方法setSelectTab(0);不会正确显示选中图标,调用setSelectTab(1);就能正确显示

@nxnyk
Copy link

nxnyk commented Oct 14, 2019

同问

@ziKunLi
Copy link
Author

ziKunLi commented Oct 17, 2019

如图,显示的是未选中的图标,字体是选中的字体
screenshot_20191017_162017
代码:
`package com.example.first;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.jpeng.jptabbar.JPTabBar;
import com.jpeng.jptabbar.anno.NorIcons;
import com.jpeng.jptabbar.anno.SeleIcons;
import com.jpeng.jptabbar.anno.Titles;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public class MainActivity extends AppCompatActivity {

@Titles
private static final String[] mTitles = {"页面一","页面二","页面三"};

@SeleIcons
private static final int[] mSeleIcons = {R.drawable.ic_home_blue,R.drawable.ic_find_blue,R.drawable.ic_personal_blue};

@NorIcons
private static final int[] mNormalIcons = {R.drawable.ic_home, R.drawable.ic_find, R.drawable.ic_personal};

@BindView(R.id.bottomBar)
JPTabBar bottomBar;

private Unbinder unbinder;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    unbinder = ButterKnife.bind(this);
    initView();
}


private void initView(){
    bottomBar.setTitles(mTitles)
            .setNormalIcons(mNormalIcons)
            .setSelectedIcons(mSeleIcons)
            .generate();
    bottomBar.setSelectTab(0);

}

}
`

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