简体   繁体   中英

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. 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 ?

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.

<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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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