且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android的抽屉式导航栏显示指标的下层碎片

更新时间:2022-12-29 08:36:25

在分析的时候,我发现这个问题是我现在用的是创造它时,内置的导航抽屉的活动。内置的分离任务分为二。 MainActivity NavigationDrawerFragment 。因此, drawerToggle 我在 MainActivity 是不一样的现实之一 NavigationDrawerFragment

After days of analyzing, I discovered that the problem is I am using the built-in navigation drawer activity when creating it. The built-in separate the tasks into two. MainActivity and NavigationDrawerFragment. Thus, the drawerToggle I have in MainActivity is not the same as the real one in NavigationDrawerFragment.

Oroginally, MainActivty 电话 NavigationDrawerFragment 来设置所有需要的导航抽屉的东西。我的解决通过实现导航抽屉里我的 MainActivity ,所以我只有一个 drawerToggle 。不过,我仍然无法找到,使其工作,如果我拥有了一切(导航抽屉变量)的 NavigationDrawerFragment ,而不是 MainActivity 路code>。如果有人知道这个问题的答案,请随时发表评论!

Oroginally, MainActivty calls NavigationDrawerFragment to setup all the things needed for navigation drawer. I SOLVED this by implementing navigation drawer in my MainActivity, so I'll have only one drawerToggle. Though, I still can't find the way to make it work if I have everything (the navigation drawer variables) in NavigationDrawerFragment rather than MainActivity. If anyone knows the answer to that, feel free to leave a comment!