【发布时间】:2026-01-01 22:30:01
【问题描述】:
我得到一个带有 androidx.appcompat.widget.Toolbar 的布局
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
tools:context=".Activity.Home">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintTop_toTopOf="parent"
android:backgroundTint="#4862ed"
app:titleTextColor="#ffff"/>
</androidx.constraintlayout.widget.ConstraintLayout>
所以我想更改工具栏中设置的三点菜单图标的颜色,但是我没有找到任何可以正常工作的解决方案。
我尝试定义一个新样式,从活动中设置或在 xml 声明中更改它,但没有任何效果。
有人可以帮助我吗?
【问题讨论】:
标签: android android-toolbar androidx android-theme