【发布时间】:2015-08-13 11:43:30
【问题描述】:
我不知道如何创建一个页脚,当页脚被拉起时,音乐播放器的选项就会出现。我正在使用滑动标签布局。
【问题讨论】:
我不知道如何创建一个页脚,当页脚被拉起时,音乐播放器的选项就会出现。我正在使用滑动标签布局。
【问题讨论】:
您要查找的 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 中已被弃用。
【讨论】:
【讨论】: