在我当前的项目中,我正在尝试将工具栏的颜色及其标题文本从当前颜色转换为新颜色。但是我在工具栏中找不到类似的功能,toolbar.getTitleTextColor()但是有一个设置颜色的功能。
这是我的布局
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:alpha="0.7"
android:id="@+id/bottombarAppbar"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/bottombarToolbar"
app:navigationIcon="@drawable/ic_hide"
app:title="Categories"
app:titleTextColor="#fafafa"
android:layout_width="match_parent"
android:layout_height="?actionBarSize" />
</com.google.android.material.appbar.AppBarLayout>
下面的语句会导致错误,因为它没有定义。
bottombarToolbar.getTitleTextColor()
我错过了什么吗?