我有一个使用SupportActionBar的应用程序。我正在为操作使用自定义视图。
问题是,默认操作在长按时显示工具提示,但我的自定义操作没有显示。
这里是默认操作(可以看到有工具提示):
这是我的自定义操作(没有工具提示):
这两个的XML:
问题是,默认操作在长按时显示工具提示,但我的自定义操作没有显示。
这里是默认操作(可以看到有工具提示):
![Action item with tool-tip](https://istack.dev59.com/d6Koz.webp)
![enter image description here](https://istack.dev59.com/ThIWW.webp)
<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto">
<item
android:visible="false"
android:title="Clear history"
android:id="@+id/action_clear_history"
custom:showAsAction="always"
android:icon="@drawable/ic_action_trash" />
<item
android:title="Open chat"
android:id="@+id/action_chat"
custom:showAsAction="always"
custom:actionLayout="@layout/ab_chat" />
</menu>
有人可以帮忙吗?