【发布时间】:2013-11-23 16:15:38
【问题描述】:
在我的应用程序中,我使用的是 Navigation Drawer,它运行良好。但是,如果要显示的 Fragment 包含很多 TextView、ImageView 和 Layout,当我单击该项目时,视图会出现故障。我会改善这种滞后。我的 Galaxy Nexus 和 Nexus 4 的效果是一样的,所以我认为问题是我同时有 2 个命令。
//On item click - First comand (Close Drawer)
mDrawerList.setItemChecked(position, true);
setTitle(mStringTitles[position]);
mDrawerLayout.closeDrawer(mDrawerView);
// Second comand (Replace Fragment)
getFragmentManager()
.beginTransaction()
.replace(R.id.firts_view, new FragmentNew())
.commit();
所以我想我会在菜单关闭后替换片段......有什么想法吗?
【问题讨论】:
标签: android performance view android-fragments navigation-drawer