0

私の Android アプリケーションでは、レイアウトにカスタム通知バーを実装する必要があります。ユーザーがこのカスタム通知バーをドラッグすると、アイコンが表示されます。このカスタム通知バーは、Facebook Android アプリケーションの下部にある通知バーのように見えます。誰かがこれを行う方法を知っている場合は、私と共有してください。

4

1 に答える 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: Damn that Sliding Drawer

于 2011-10-31T09:55:39.023 に答える