MagicIndicator
MagicIndicator copied to clipboard
Indicator被遮挡不显示
@Override public IPagerTitleView getTitleView(Context context, int index) { ColorTransitionPagerTitleView colorTransitionPagerTitleView = new ColorTransitionPagerTitleView(context); colorTransitionPagerTitleView.setBackground(getResources().getDrawable(R.drawable.green_ripple)); colorTransitionPagerTitleView.setText(accountTypes.get(index).getTypeName()); colorTransitionPagerTitleView.setTextSize(15); //选中时字体颜色 colorTransitionPagerTitleView.setSelectedColor(getResources().getColor(R.color.white)); //未选中时字体颜色 colorTransitionPagerTitleView.setNormalColor(getResources().getColor(R.color.gray_b2)); colorTransitionPagerTitleView.setOnClickListener(v -> mBinding.viewPage.setCurrentItem(index)); return colorTransitionPagerTitleView; }
设置setBackground之后,指示器就不显示了,请问有解决办法吗
CommonNavigator.setIndicatorOnTop(true)