문제

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