【问题标题】:Android How to make sliding menu?Android 如何制作滑动菜单?
【发布时间】:2015-10-07 03:55:23
【问题描述】:

目前我正在尝试插入一种下拉式滑动菜单(不知道它是如何调用的)。这个想法是用户触摸箭头或菜单的任何区域并向上拖动以打开菜单。但我不知道如何或在哪里可以找到这个教程。

【问题讨论】:

标签: java android


【解决方案1】:

查看发布在 github 上的代码:https://github.com/umano/AndroidSlidingUpPanel

您可以在滑动菜单中设计自己的视图。

<com.sothree.slidinguppaneldemo.SlidingUpPanelLayout
    android:id="@+id/sliding_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="My Content"
        android:textSize="16sp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center|top"
        android:text="Another Content"
        android:textSize="16sp" />
</com.sothree.slidinguppaneldemo.SlidingUpPanelLayout>

【讨论】:

  • 希望库满足您的要求
【解决方案2】:

最简单的方法是使用像 https://github.com/umano/AndroidSlidingUpPanel 这样的库

但是自从 google 发布了 CoordinatorLayoutBehavior 我建议你看一下,虽然它有点新而且更难做。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-02
    • 1970-01-01
    • 1970-01-01
    • 2017-08-05
    • 2013-05-28
    相关资源
    最近更新 更多