如何平滑隐藏动作模式工具栏然后显示动作栏 问题注意

问题描述

我有一个回收器视图,当用户长按一个项目时,我用 beginActionMode 开始操作模式,然后在选择完成后完成操作模式。

问题

是当动作模式完成并隐藏其工具栏时,我在 onDestroyActionMode显示我的 但视野先下后上。

如何顺利隐藏动作模式工具栏,然后在没有视图混蛋的情况下显示动作栏。

注意

beginActionMode 中,视图不会抖动,只有在关闭操作模式时才会抖动。

这里是beginActionMode

private boolean beginActionMode () {
  if (fActionMode == null) {
    fSwipeRefereshLayout.setEnabled (false);
    fActionMode = startSupportActionMode (this);
    // I hide the action bar here
    getSupportActionBar ().hide ();
    fSelectingItems = true;
    fSelectedItems.clear ();
    return true;
  }
  fActionMode.invalidate ();
  return false;
}

onDestroyActionMode

@Override
public void onDestroyActionMode (ActionMode am) {
  fActionMode = null;
  fSelectingItems = false;

  selectAll ();
  fTabLayout.setClickable (true);
  // I show action bar here
  getSupportActionBar ().show ();
  fSwipeRefereshLayout.setEnabled (true);
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)