Плъзгащото се чекмедже не се показва

Искам да имам плъзгащо се чекмедже, което да се показва в долната част на моя изглед, но в момента не се показва. Също така се опитах да използвам линейно оформление, тъй като коренът с изгледа за превъртане има тегло 1, но това накара изгледа за превъртане и неговото съдържание да не се показват. Някакви идеи?

Моят изглед:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ScrollView
    android:id="@+id/scrollLayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:context=".AddScheduleItemActivity" >

        .
        .
        .

    </LinearLayout>
</ScrollView>

<SlidingDrawer
    android:id="@+id/slidingDrawer1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/scrollLayout"
    android:content="@+id/content"
    android:handle="@+id/handle" >

    <Button
        android:id="@+id/handle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Handle" />

    <LinearLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <Button
            android:id="@+id/hadsfndle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="sdf" />
    </LinearLayout>
</SlidingDrawer>

Thanks, Nathan

Как трябва да изглежда

На снимката искам синьото да е изгледът за превъртане и съдържанието, а зеленото да е дръжката на плъзгача.

Опитах да следвам някои други предложения и стигнах до това, което все още не работи. Съдържанието на изгледа за превъртане се показва добре, но плъзгачът не се показва. Нуждаете се от още предложения! Благодаря!

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:gravity="bottom"
android:orientation="vertical" >

<ScrollView
    android:id="@+id/scrollLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        .
        .
        .

    </RelativeLayout>
</ScrollView>

<SlidingDrawer
    android:id="@+id/slidingDrawer1"
    android:layout_width="match_parent"
    android:layout_height="50dip"
    android:layout_alignParentBottom="true"
    android:layout_below="@+id/scrollLayout"
    android:content="@+id/content"
    android:handle="@+id/handle"
    android:orientation="vertical" >

    <Button
        android:id="@+id/handle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Handle" />

    <LinearLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <Button
            android:id="@+id/hadsfndle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="sdf" />
    </LinearLayout>
</SlidingDrawer>

</RelativeLayout>

Е, изглежда, че плъзгащото се чекмедже вече не се поддържа, така че предполагам, че ще потърся алтернатива :(


person Nath5    schedule 05.02.2013    source източник
comment
Можете ли да ми кажете къде точно искате вашия слайдер? В долната част на екрана или в горната част на екрана? Тествах вашето оформление и показващия му плъзгач в долната част и се отваря отдолу нагоре.   -  person GrIsHu    schedule 05.02.2013
comment
Искам го на дъното. С оформлението, което публикувах, може да видите плъзгача, защото няма нищо в линейното оформление. Добавете куп елементи, докато надхвърлят пространството на екрана. В този момент изгледът за превъртане избутва дръжката на плъзгача извън екрана.   -  person Nath5    schedule 05.02.2013


Отговори (3)


Опитвате се да покажете своя sliderdrawar в долната част, опитайте кода по-долу:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    >

    <ScrollView
        android:id="@+id/scrollLayout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >

        <LinearLayout
            android:id="@+id/layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical" >


        </LinearLayout>
    </ScrollView>

    <LinearLayout
        android:id="@+id/LinearLayout01"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_below="@+id/layout"
        android:orientation="vertical" >

        <SlidingDrawer
            android:id="@+id/SlidingDrawer"
            android:layout_width="wrap_content"
            android:layout_height="250dip"
            android:content="@+id/contentLayout"
            android:handle="@+id/slideHandleButton"
            android:padding="10dip" >

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

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

                <Button
                    android:id="@+id/Button01"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Content" >
                </Button>

                <Button
                    android:id="@+id/Button02"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Content" >
                </Button>

                <Button
                    android:id="@+id/Button03"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Content" >
                </Button>
            </LinearLayout>
        </SlidingDrawer>
    </LinearLayout>

</RelativeLayout>

Ако горният код не реши проблема ви, тогава променете родителското оформление на LinearLayout дайте weightsum=10 и след това разпределете между вашите scrollview & sliderDrawer по равно.

person RobinHood    schedule 05.02.2013

Опитайте тази,

Добавете layout_alignParentBottom към вашия SlidingDrawer.

 android:layout_alignParentBottom="true"
person MuraliGanesan    schedule 05.02.2013

Може би въпросът ви вече е бил отговор тук.

Опитайте тази:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
 >

<ScrollView
    android:id="@+id/scrollLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        .
        .
        .

    </RelativeLayout>
</ScrollView>

<SlidingDrawer
    android:id="@+id/slidingDrawer1"
    android:layout_width="match_parent"
    android:layout_height="50dip"
    android:layout_alignParentBottom="true"
    android:content="@+id/content"
    android:handle="@+id/handle"
    android:orientation="vertical" >

    <Button
        android:id="@+id/handle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Handle" />

    <LinearLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <Button
            android:id="@+id/hadsfndle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="sdf" />
    </LinearLayout>
</SlidingDrawer>

</RelativeLayout>
person r.pedrosa    schedule 07.01.2015