SlidingDrawer隐藏在Scrollview后面

时间:2012-06-22 06:35:15

标签: android slidingdrawer

我第一次使用slidedrawer,我不知道为什么它会被隐藏或者最糟糕的是没有显示在。我不知道请帮忙。 这是我的XML代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrllvwNo1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#F1F3F2"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#BDBEC0"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="60dp"
            android:layout_gravity="center_vertical|center_horizontal"
            android:layout_marginBottom="15dp"
            android:background="@drawable/titlebar"
            android:gravity="center_vertical|center_horizontal|center"
            android:orientation="horizontal"
            android:paddingLeft="10dp"
            android:paddingRight="10dp" >

            <Button
                android:id="@+id/cancelButton"
                style="@style/ButtonText"
                android:layout_width="0dp"
                android:layout_height="40dp"
                android:layout_gravity="right|center_vertical"
                android:layout_weight="1"
                android:background="@drawable/button"
                android:text="@string/cancelButton" >
            </Button>

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|center_horizontal"
                android:layout_weight="2"
                android:gravity="center_vertical|center_horizontal|center"
                android:text="@string/Terms"
                android:textColor="#fff"
                android:textSize="23sp" />

            <Button
                android:id="@+id/agreeButton"
                style="@style/ButtonText"
                android:layout_width="0dp"
                android:layout_height="40dp"
                android:layout_gravity="right|center_vertical"
                android:layout_weight="1"
                android:background="@drawable/button"
                android:text="@string/agreeButton" >
            </Button>
        </LinearLayout>
        </LinearLayout>

        <ScrollView
            android:id="@+id/SCROLLER_ID"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="#F1F3F2"
            android:fillViewport="true"
            android:padding="15dp"
            android:paddingBottom="20dp"
            android:scrollbars="vertical" >

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dp"
                android:layout_marginRight="15dp"
                android:layout_marginTop="20dp"
                android:text="@string/termsText"
                android:textColor="#595B5A"
                android:textSize="14sp" />
        </ScrollView>
    <SlidingDrawer
        android:id="@+id/SlidingDrawer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:content="@+id/contentLayout"
        android:handle="@+id/slideHandleButton"
        android:background="#00000000"
        android:padding="10dip"
        android:topOffset="-50dp" >

        <Button
            android:id="@+id/slideHandleButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#00000000" >
        </Button>

        <LinearLayout
            android:id="@+id/contentLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/titlebar"
            android:gravity="center|top"
            android:orientation="vertical"
            android:padding="22dip" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dp"
                android:layout_marginTop="20dp"
                android:text="@string/emailValidateConfirmationText"
                android:textColor="#fff"
                android:textSize="14sp" />

            <Button
                android:id="@+id/okButtonCreateAccount"
                style="@style/ButtonText"
                android:layout_width="90dp"
                android:layout_height="wrap_content"
                android:background="@drawable/button"
                android:text="@string/ok" >
            </Button>
        </LinearLayout>
    </SlidingDrawer>
</LinearLayout>

使用以下按钮单击按钮调用此滑块:

slider.animateOpen(); 

在我的代码中。我还把滑块按照

进行了调整
SlidingDrawer slider = (SlidingDrawer) findViewById(R.id.SlidingDrawer);

1 个答案:

答案 0 :(得分:0)

您已将滑块按钮的背景设置为#00000000,它是完全透明的黑色(不可见)。尝试使用#FF000000或#F000。

相关问题