Navigation Drawer is slow with complex view

孤人 提交于 2019-11-30 20:10:29

As the documentation says:

Avoid performing expensive operations such as layout during animation as it can cause stuttering;
try to perform expensive operations during the STATE_IDLE state.

What you could do, is have an event listener for your drawer, and do the fragment operation in the onDrawerClosed callback (example here).

I have found that if you load the views in the fragment in the onCreateView() method it will slow down the fragment loading. Try loading the fragment related views in the onStart() method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!