0

我想要实现的是以动态方式更改TextViewActionBar显示某些字段的特定值。

我想要实现的是在 ABS 中创建一个类似徽章的解决方案,其中包含一些项目的计数器。我知道如何替换 ABS 中的图形,但这超出了我的理解范围。

4

2 回答 2

3

怎么样:

ActionBar actionBar = getSupportActionBar();
        if (actionBar != null)
        {
            actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.background));
            actionBar.setIcon(R.drawable.icon);
            actionBar.setTitle(title);
        }
于 2012-09-26T10:53:42.560 回答
0

尝试这个...

  int titleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");

    TextView yourTextView = (TextView)findViewById(titleId);
    yourTextView.setText("TITLE TEXT");
于 2012-12-03T05:53:43.483 回答