我可以使用什么而不是滑动抽屉

时间:2015-10-23 17:31:33

标签: java android xml slidingdrawer

即时制作启动器应用。在教程中它使用了在Api 17中弃用的Sliding Drawer。我可以使用什么代替呢?我尝试使用其中一个帖子的Slideup Panel链接下面的gitHub

gitHubLink https://github.com/umano/AndroidSlidingUpPanel

。但它不允许我以我想要的方式使用它。我希望应用程序出现在抽屉中而不是主要内容中。由于某种原因,第二个视图只允许我创建一个Text视图,该视图用于将其向上滑动的句柄。关于我可以用什么其他方法做同样工作的任何建议。它必须从底部向上滑动。感谢所有的帮助

1 个答案:

答案 0 :(得分:0)

好的伙计们这样做了。使用GitHub我在问题中发布了。它的作用是因为尽可能多的布局和我喜欢但只有2个孩子。我使用相对布局作为我的第一个布局,使用gridView作为我的主屏幕应用程序内部并关闭它。然后我使用另一个相对布局下面的textview里面然后另一个相对布局设置在顶部80dp填充(我的文本句柄的大小)在这个内部我有我的应用程序的另一个gridview并关闭它。

它的Xml看起来像这样



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent"  tools:context=".MainActivity"
    android:id="@+id/Mainlayout"
    >










    <com.sothree.slidinguppanel.SlidingUpPanelLayout
        xmlns:sothree="http://schemas.android.com/apk/res-auto"
        android:id="@+id/sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="bottom"
        sothree:umanoPanelHeight="80sp"
        sothree:umanoShadowHeight="4dp"
        sothree:umanoDragView ="@+id/dragView"
        sothree:umanoScrollableView="@+id/list"

        >


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

        <GridView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/content1"
            android:columnWidth="90dp"
            android:numColumns="auto_fit"
            android:verticalSpacing="50dp"
            android:horizontalSpacing="50dp"
            android:stretchMode="columnWidth"
            android:gravity="center"
            android:clickable="true"
            >

        </GridView>
        </RelativeLayout>

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

            <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/handle"
                android:text="b"
                android:textSize="80sp"
                android:textColor="#17ff1c"
                android:gravity="center|top"
                android:clickable="true" />



        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingTop="80sp"
            android:id="@+id/dragView"
            android:clickable="true"
            android:focusable="false">

            >



            <GridView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingBottom="80sp"
                android:id="@+id/content"
                android:columnWidth="90dp"
                android:numColumns="auto_fit"
                android:verticalSpacing="50dp"
                android:horizontalSpacing="50dp"
                android:stretchMode="columnWidth"
                android:gravity="center"

                >

            </GridView>
        </RelativeLayout>

        </RelativeLayout>
    </com.sothree.slidinguppanel.SlidingUpPanelLayout>


</RelativeLayout>
&#13;
&#13;
&#13;