Android 修改 Menu字体颜色

转载:http://blog.csdn.net/jayyuz/article/details/55260996


@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_test, menu);
MenuItem item = menu.findItem(R.id.menu_test);
SpannableString spannableString = new SpannableString(item.getTitle());
spannableString.setSpan(new ForegroundColorSpan(Color.WHITE), 0, spannableString.length(), 0);
item.setTitle(spannableString);
return super.onCreateOptionsMenu(menu);
}
上一篇:(Step1-500题)UVaOJ+算法竞赛入门经典+挑战编程+USACO


下一篇:Disk IO Performance