Android: how to hide the navigation bar and optionmenu in the login clip?

I have one activity and three clips. The clip I display is the login clip. I want to hide the navigation bar floating operation button and options menu in the login clip and display them in the other two clips. How do I implement it?

resolvent:

After a long time of research, I found a solution. That is, I used the following code to lock the navigation drawer in the login fragment:

    DrawerLayout drawer = (DrawerLayout)      getActivity().findViewById(R.id.drawer_layout);
    drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

Use the following code again to unlock the navigation drawer in the welcome clip

  DrawerLayout drawer = (DrawerLayout)   getActivity().findViewById(R.id.drawer_layout);
  drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNDEFINED);

The same is true of the options menu

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>