我正在寻找文本粗体的方式,基本上是 Tab Host 使文本粗体。
示例图像如下
下面是我的代码。
tabHost.setOnTabChangedListener(new OnTabChangeListener()
{
@Override
public void onTabChanged(String tabId)
{
if (tabId.equals("READING"))
{
for(int i=0;i< tabHost.getTabWidget().getChildCount();i++)
{
//unselected
tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#E6A9EC"));
}
// selected
tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.WHITE);
}
else
{
for(int i=0;i< tabHost.getTabWidget().getChildCount();i++)
{
//unselected
tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#E6A9EC"));
}
// selected
tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.WHITE);
}
}
});