我想知道图像中实现的 Android Activity 的类型是什么,您可以在其中放置例如配置并使用滑动手势隐藏它
问问题
2650 次
3 回答
3
它是Navigation Drawer一个面板,它从屏幕的左边缘过渡并显示应用程序的主要导航选项。
您可以在此处找到如何创建导航抽屉
<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 时,抽屉会出现在右侧)。
于 2013-05-23T04:05:40.503 回答
1
这被称为滑动菜单或导航抽屉。
谷歌上周发布了他们自己的实现:http: //developer.android.com/training/implementing-navigation/nav-drawer.html
在此之前最流行的实现可能是这个SlidingMenu
组件。
于 2013-05-23T04:03:05.177 回答