【问题标题】:Custom Notification Bar in AndroidAndroid中的自定义通知栏
【发布时间】:2011-10-31 09:45:13
【问题描述】:

对于我的 android 应用程序,我的要求是在我的布局中实现自定义通知栏。当用户拖动此自定义通知栏时,图标将可见。这个自定义通知栏看起来像 Facebook Android 应用程序底部的通知栏。如果有人知道如何做到这一点,请与我分享。

【问题讨论】:

    标签: android layout notification-bar


    【解决方案1】:

    您可以使用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

    【讨论】:

    • 非常感谢。我想念android中的这个控件。
    • @AndroidDeveloper 没有问题,但是这次通过这个控件,所以你以后不必寻找这个视图。干杯:)
    • 这将使应用程序正常运行。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多