Android活动从左到右在前面

时间:2013-05-23 03:59:11

标签: android android-activity

我想知道图片中实现的Android Activity的类型,您可以在其中放置示例配置并使用滑动手势隐藏它

enter image description here

3 个答案:

答案 0 :(得分:3)

看起来像Navigation DrawerNavigation Drawer是一个从屏幕左边缘过渡的面板,显示应用的主要导航选项。

有关详细信息,请访问开发人员 Link

enter image description here

enter image description here

以下是GitHub链接,您可以在其中找到Navigation Drawer源代码

Navigation Drawer Source Code Link 1

Navigation Drawer Source Code Link2

Navigation Drawer Source Code Link 3

Navigation Drawer Source Code Link 4

More Collection

答案 1 :(得分:3)

Navigation Drawer面板从屏幕左边缘过渡,显示应用的主要导航选项。

enter image description here

您可以找到如何Create a Navigation Drawer 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>

抽屉视图(ListView)必须使用android:layout_gravity属性指定其水平重力。要支持从右到左(RTL)语言,请使用“start”而不是“left”指定值(因此当布局为RTL时,抽屉会出现在右侧。)

答案 2 :(得分:1)

它被称为滑动菜单或navigation drawer

Google上周发布了自己的实施:http://developer.android.com/training/implementing-navigation/nav-drawer.html

之前最受欢迎的实现可能是this SlidingMenu component