ActionbarSherlock: Long-click on action item show a Toast?

前端 未结 2 1519
再見小時候
再見小時候 2021-02-06 04:48

When an action item is long-clicked, a Toast without text is show below the action item. Can I disable the Toast? Thanks you.

相关标签:
2条回答
  • 2021-02-06 05:17

    If you omit a title or specify that the action item should be displayed with text then long-pressing will not toast. Otherwise the toast adds clarification of what each action item represents.

    0 讨论(0)
  • 2021-02-06 05:21

    Using this answer to get the action bar view: https://stackoverflow.com/a/21125631/555914 I used this to disable the toast:

    View actionBar = AppUtils.getActionBarView(getActivity());
            if(actionBar!=null) {
                View item = actionBar.findViewById(id);
                if(item!=null) {
                    item.setOnLongClickListener(null);
                }
            }
    

    Although I do not recommend disabling this functionality but sometimes designers want something for esthetic reasons...

    0 讨论(0)
提交回复
热议问题