菜鸟教程小白 发表于 2022-12-12 15:51:57

android - 是否有 SWRevealViewController 的 Android 版本?


                                            <p><p>我一直在使用 SWRevealViewController 作为我在 iOS 中的应用程序的基础,我想在 Android 中找到一个类似物。我希望保持与 John LLuch 的 SWRevealViewController <a href="https://www.cocoacontrols.com/controls/swrevealviewcontroller" rel="noreferrer noopener nofollow">https://www.cocoacontrols.com/controls/swrevealviewcontroller</a> 中出现的相同的抽屉效果。 .</p>

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

<p>如果你们知道或知道如何让固定标签 Controller 做到这一点,请告诉我。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>Google 有一个类似于 SWRevealController 的 navigationDrawer。然而,在我们所有的项目中,我们使用 <a href="https://github.com/adamrocker/simple-side-drawer/tree/master/SimpleSideDrawer" rel="noreferrer noopener nofollow">https://github.com/adamrocker/simple-side-drawer/tree/master/SimpleSideDrawer</a>因为它似乎更容易习惯。</p>

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

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

<pre><code>      mNav = new SimpleSideDrawer(this);
      mNav.setLeftBehindContentView(R.layout.menu_left);
      mNav.setRightBehindContentView(R.layout.menu_right);
</code></pre>

<p>希望对你有帮助!</p></p>
                                   
                                                <p style="font-size: 20px;">关于android - 是否有 SWRevealViewController 的 Android 版本?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/19498211/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/19498211/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: android - 是否有 SWRevealViewController 的 Android 版本?