我想要实现的是以动态方式更改TextView
以ActionBar
显示某些字段的特定值。
我想要实现的是在 ABS 中创建一个类似徽章的解决方案,其中包含一些项目的计数器。我知道如何替换 ABS 中的图形,但这超出了我的理解范围。
我想要实现的是以动态方式更改TextView
以ActionBar
显示某些字段的特定值。
我想要实现的是在 ABS 中创建一个类似徽章的解决方案,其中包含一些项目的计数器。我知道如何替换 ABS 中的图形,但这超出了我的理解范围。
怎么样:
ActionBar actionBar = getSupportActionBar();
if (actionBar != null)
{
actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.background));
actionBar.setIcon(R.drawable.icon);
actionBar.setTitle(title);
}
尝试这个...
int titleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");
TextView yourTextView = (TextView)findViewById(titleId);
yourTextView.setText("TITLE TEXT");