0
這裏是我在操作欄項目添加到菜單:棒棒糖actionbar菜單項文字是黑色而不是白色?
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
TypefaceSpan actionBarTypeFace = new CustomTypefaceSpan("", a.bumpFont);
SpannableString s = new SpannableString("Done"));
s.setSpan(actionBarTypeFace, 0, s.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
MenuItem item = menu.add(21, 142, 0, s);
item.setTitle(BaseActivity.isLGDevice() ? "Done") : s);
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
// fix android formatted title bug
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2 && item.getTitleCondensed() != null) {
item.setTitleCondensed("Done"));
}
}
項字體通常是白色的,但其對棒棒堂黑。任何人都知道這是什麼原因,我該如何解決?