对于我的 android 应用程序,我的要求是在我的布局中实现自定义通知栏。当用户拖动此自定义通知栏时,图标将可见。这个自定义通知栏看起来像 Facebook Android 应用程序底部的通知栏。如果有人知道如何做到这一点,请与我分享。
问问题
2747 次
1 回答
0
您可以使用SlidingDrawer。
例如:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"/>
<SlidingDrawer
android:id="@+id/slidingDrawer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:handle="@+id/handle"
android:content="@+id/content">
<Button
android:id="@id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Drawer Handle"/>
<TextView
android:id="@id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/grey"
android:text="This is the content of the drawer"/>
</SlidingDrawer>
</FrameLayout>
更新:
带有详细说明的好教程:Android:该死的滑动抽屉
于 2011-10-31T09:55:39.023 回答