OGeek|极客世界-中国程序员成长平台

标题: android - 是否有 SWRevealViewController 的 Android 版本? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 15:51
标题: android - 是否有 SWRevealViewController 的 Android 版本?

我一直在使用 SWReveal View Controller 作为我在 iOS 中的应用程序的基础,我想在 Android 中找到一个类似物。我希望保持与 John LLuch 的 SWRevealViewController https://www.cocoacontrols.com/controls/swrevealviewcontroller 中出现的相同的抽屉效果。 .

我知道您可以使用抽屉式导航 Controller 来显示左侧,但这是一个弹出窗口。这不像将中央屏幕向右移动。我也知道有固定标签 Controller ,但那些也不允许中心屏幕显示在顶部。我希望有人在 android 中模仿了一个 Controller ,它允许您移动三个屏幕,就好像您在它们之间进行分页一样,并且始终显示您的中心屏幕。

如果你们知道或知道如何让固定标签 Controller 做到这一点,请告诉我。



Best Answer-推荐答案


Google 有一个类似于 SWRevealController 的 navigationDrawer。然而,在我们所有的项目中,我们使用 https://github.com/adamrocker/simple-side-drawer/tree/master/SimpleSideDrawer因为它似乎更容易习惯。

这并不完全相同,但您会得到相同的结果。我们总是制作一个所有菜单 Activity 都扩展的基础 Activity ,以便获得菜单的操作。

就像有一个 FragmentActivity 并在 onCreate 方法上添加这些:

        mNav = new SimpleSideDrawer(this);
        mNav.setLeftBehindContentView(R.layout.menu_left);
        mNav.setRightBehindContentView(R.layout.menu_right);

希望对你有帮助!

关于android - 是否有 SWRevealViewController 的 Android 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19498211/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4