我正在使用BottomNavigationView来管理碎片。是否有简单的解决方案可以更改选项卡项字体?我尝试使用SpannableStringBuilder,但它并没有起作用。
for (int i = 0; i < bottomBar.getMenu().size(); i++) {
MenuItem menuItem = binding.bottomBar.getMenu().getItem(i);
SpannableStringBuilder title = new SpannableStringBuilder(menuItem.getTitle());
title.setSpan(mTypeface, 0, title.length(), 0);
menuItem.setTitle(title);
}