简体   繁体   English

Android替换上下文操作栏上的确认

[英]android replace confirm on contextual action bar

I want to delete the confirm button that appears on left side of CAB when my app si in selection mode. 我要删除在选择模式下我的应用程序si出现在CAB左侧的确认按钮。 Or replace it with a back button. 或将其替换为后退按钮。

I have a single selection mode, so, in contextual action bar I need only title, and a back button. 我只有一个选择模式,因此在上下文操作栏中,我仅需要标题和后退按钮。

I follow android tutorial and all work fine, but now how can I remove default confirm ? 我遵循android教程,一切正常,但是现在如何删除默认确认?

You can change the icon on the top left by changing it in the theme. 您可以通过更改主题中的图标来更改左上角的图标。

If you styles.xml, create a new theme if you don't have one already. 如果您使用styles.xml,请创建一个新主题(如果尚未创建)。

<style name="Theme.Custom.Light" parent="Holo.Theme.Light">
    <item name="android:actionModeCloseDrawable">@drawable/ic_menu_checkmark</item>
</style>

You can put in any drawable here. 您可以在此处放入任何可绘制对象。 Just tried it and it worked. 只是尝试它,它的工作原理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM