質問

For my android application my requirement is to implement the Custom Notification Bar in my layout. When user drag this Custom notification bar then icons will be visible. This custom notification bar is look like notification bar at the bottom in the Facebook Android Application. If anyone knows how to do this then please share with me.

役に立ちましたか?

解決

You can use SlidingDrawer.

For example:

<?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>

Update:

Nice tutorial with detailed description: Android: Damn that Sliding Drawer

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top