如何在布局的中心添加工具栏标题

时间:2015-11-17 10:36:52

标签: android android-actionbar

我搜索了很多,但我无法得到正确的答案。通常我们将其用作

toolbar=(Toolbar)findViewById(R.id.toolbar_to_updates);
        setSupportActionBar(toolbar);
        android.support.v7.app.ActionBar bar=getSupportActionBar();
        bar.setDisplayHomeAsUpEnabled(true);
        bar.setHomeButtonEnabled(true);
        bar.setTitle("Updates");

1 个答案:

答案 0 :(得分:1)

您找到Toolbar但尝试在ActionBar中进行更改。它们是不同的。 点击Android toolbar center title and custom font

相关问题