【发布时间】:2015-08-06 18:21:14
【问题描述】:
所以我一直关注Slidnerd tutorial on the Navigation Drawer。当我试图创建一个 ActionBarDrawerToggle 实例来指定Activity、DrawerLayout 和Toolbar 时,就会出现问题。
(NavigationDrawerFragment)getSupportFragmentManager().findFragmentById(R.id.fragment_nav_drawer);
drawerFragment.setUp((DrawerLayout) findViewById (R.id.drawer_layout, toolbar);
我在 (R.id.drawer_layout,工具栏) 中遇到错误。错误提示:" Activity 中的 findViewById (int) 无法应用于 (int, android.support.v7.widget.Toolbar"。
我尝试了一个建议的解决方案,即导入 android.support.v4.app.Fragment,但即使尝试了这个问题仍然存在,我什至反之亦然。如果需要,我也愿意发布我的相关代码。
有谁知道如何解决这个问题?
感谢所有帮助。谢谢,祝您有美好的一天!
【问题讨论】:
标签: android android-fragments navigation-drawer android-toolbar drawerlayout