隐藏的吐司上动作条项目长preSS [英] Hiding of the Toast for long press on actionBar item

查看:224
本文介绍了隐藏的吐司上动作条项目长preSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

时的一些可能的方式如何隐藏后的动作条项目长期preSS敬酒?我没有设置该项目冠军,但它仍然存在 - 空烤面包

Is some possible way how to hide the toast after long-press on the ActionBar item? I didn't setup a title for the item but it is still there - empty toast.

<item
    android:id="@+id/ab_main_menu_dots"
    android:icon="@drawable/action_icons_dots"
    android:showAsAction="always">
    <menu>
        <item
            android:id="@+id/ab_main_menu_my_profile"
            android:showAsAction="never"
            android:title="@string/ab_my_profile">
        </item>
        <item
            android:id="@+id/ab_main_menu_settings"
            android:showAsAction="never"
            android:title="@string/menu_settings">
        </item>
        <item
            android:id="@+id/ab_main_menu_help"
            android:showAsAction="never"
            android:title="@string/tv_help_login">
        </item>
        <item
            android:id="@+id/ab_main_menu_about_us"
            android:showAsAction="never"
            android:title="@string/ab_about_us">
        </item>
        <item
            android:id="@+id/ab_main_menu_logout"
            android:showAsAction="never"
            android:title="@string/bt_logout_main">
        </item>
    </menu>
</item>

推荐答案

您可以修改 onLongClick 的<一个href="https://github.com/JakeWharton/ActionBarSherlock/blob/master/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuItemView.java"相对=nofollow> ActionMenuItemView 类停止祝酒上长按。
但要注意,这只是工作的设备上使用API​​小于11,因为sherlockactionbar库由 Build.VERSION.SDK_INT 检查设备API级别,如果你有更新的设备,它只是使用系统默认的动作条而你没有修改。

You can modify onLongClickin ActionMenuItemView Class to stop Toasting on long click.
but be careful, It's only working on devices with API less than 11, because sherlockactionbar library checking your device API level by Build.VERSION.SDK_INT and if you have newer device it just use default system actionbar which you're not modifying.

这篇关于隐藏的吐司上动作条项目长preSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆