слайдер заставляет мой отдых отдыхать - PullRequest
1 голос
/ 14 марта 2012

Мне нужна твоя помощь! Я хочу вставить слайдер в свое приложение. Я нашел демо-версию, и она отлично работает. Дело в том, что когда я хочу вставить его в свое приложение, я вижу только ползунок, а остальная часть моего экрана исчезает, как и его невидимый.

Это мой xml для слайдера:

xmlns:android="http://schemas.android.com/apk/res/android"

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent">



<Button

    android:id="@+id/button_open"

    android:layout_width="100dp"

    android:layout_height="wrap_content"



    android:layout_centerInParent="true"

    android:visibility="gone" />



<com.my.android.app1.widget.MultiDirectionSlidingDrawer

    xmlns:my="http://schemas.android.com/apk/res/com.my.android.app1"

    android:id="@+id/drawer"

    my:direction="bottomToTop"

    android:layout_width="fill_parent"

    android:layout_height="wrap_content"

    my:handle="@+id/handle"

    my:content="@+id/content">

    <include

        android:id="@id/content"

        layout="@layout/pen_content" />

    <ImageView

        android:id="@id/handle"

        android:layout_width="wrap_content"

        android:layout_height="40px"

        android:src="@drawable/sliding_drawer_handle_bottom" />

</com.my.android.app1.widget.MultiDirectionSlidingDrawer>

Это был мой предыдущий, скажем, xml:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    android:orientation="vertical" >



 <TextView

                android:id="@+id/Information"

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:layout_gravity="center"

                android:layout_marginTop="10dp"

                android:text="info"

                android:textColor="#FFFFFF"

                android:textStyle="bold" />

</LinearLayout>

а это мой новый:

   <?xml version="1.0" encoding="utf-8"?>

        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

            android:layout_width="fill_parent"

            android:layout_height="fill_parent"

            android:orientation="vertical" >



         <TextView

                        android:id="@+id/Information"

                        android:layout_width="wrap_content"

                        android:layout_height="wrap_content"

                        android:layout_gravity="center"

                        android:layout_marginTop="10dp"

                        android:text="info"

                        android:textColor="#FFFFFF"

                        android:textStyle="bold" />

      <RelativeLayout

            xmlns:android="http://schemas.android.com/apk/res/android"

            android:orientation="vertical"

            android:layout_width="fill_parent"

            android:layout_height="fill_parent">



            <Button

                android:id="@+id/button_open"

                android:layout_width="100dp"

                android:layout_height="wrap_content"



                android:layout_centerInParent="true"

                android:visibility="gone" />



            <com.my.android.app1.widget.MultiDirectionSlidingDrawer

                xmlns:my="http://schemas.android.com/apk/res/com.my.android.app1"

                android:id="@+id/drawer"

                my:direction="bottomToTop"

                android:layout_width="fill_parent"

                android:layout_height="wrap_content"

                my:handle="@+id/handle"

                my:content="@+id/content">

                <include

                    android:id="@id/content"

                    layout="@layout/pen_content" />

                <ImageView

                    android:id="@id/handle"

                    android:layout_width="wrap_content"

                    android:layout_height="40px"

                    android:src="@drawable/sliding_drawer_handle_bottom" />

            </com.my.android.app1.widget.MultiDirectionSlidingDrawer>

        </RelativeLayout>

        </LinearLayout>

есть идеи, почему это невидимо?

1 Ответ

0 голосов
/ 14 марта 2012

Это должно играть. Если это не так или вы хотите что-то более сложное, измените свой первый макет на Относительный. это работает для меня!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...