我的应用程序中有一个工具栏,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="#263355"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
Run Code Online (Sandbox Code Playgroud)
我添加标题:
getSupportActionBar().setTitle(title);
Run Code Online (Sandbox Code Playgroud)
我已经阅读了Android工具栏中心标题和自定义字体
但是,如果我更改工具栏的xml,我不知道如何更改TextView的值.有人可以帮帮我吗?