【发布时间】:2011-10-31 09:45:13
【问题描述】:
对于我的 android 应用程序,我的要求是在我的布局中实现自定义通知栏。当用户拖动此自定义通知栏时,图标将可见。这个自定义通知栏看起来像 Facebook Android 应用程序底部的通知栏。如果有人知道如何做到这一点,请与我分享。
【问题讨论】:
标签: android layout notification-bar
对于我的 android 应用程序,我的要求是在我的布局中实现自定义通知栏。当用户拖动此自定义通知栏时,图标将可见。这个自定义通知栏看起来像 Facebook Android 应用程序底部的通知栏。如果有人知道如何做到这一点,请与我分享。
【问题讨论】:
标签: android layout notification-bar
您可以使用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: Damn that Sliding Drawer
【讨论】: