【问题标题】:Android Layout fragmentsAndroid 布局片段
【发布时间】:2015-08-13 11:43:30
【问题描述】:

我不知道如何创建一个页脚,当页脚被拉起时,音乐播放器的选项就会出现。我正在使用滑动标签布局。

【问题讨论】:

    标签: android layout footer


    【解决方案1】:

    您要查找的 UI 元素是 DrawerLayout。您所要做的就是将其设置为 UI 层次结构的顶级元素,将视图添加到其中,然后选择一个视图以在用户从窗口边缘滑动手指时显示。

    在开发者的网站上有一篇关于如何创建这个的文章 (here),这是他们的例子之一:

    <android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent">
      <!-- The main content view -->
      <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
      <!-- The navigation drawer -->
      <ListView android:id="@+id/left_drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp"
        android:background="#111"/>
    </android.support.v4.widget.DrawerLayout>
    

    您也可以使用SlidingDrawer 来获得相同的结果,但请注意,该类在最新版本的 Android 中已被弃用。

    【讨论】:

      【解决方案2】:

      考虑使用 - ViewDragHelper: 文档位于here

      Here's 之前有人问过的类似问题。

      【讨论】:

      • 我可以使用滑动抽屉吗??
      • 非常感谢...我会在我的项目中研究这些建议。谢谢:-)
      • 滑动抽屉从左到右。我怀疑您正在寻找从下到上的音乐播放器 - 看看这个stackoverflow.com/questions/21784916/…
      猜你喜欢
      • 2013-02-07
      • 2011-07-15
      • 2017-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-10
      • 2012-09-19
      • 2013-12-18
      相关资源
      最近更新 更多