2015-10-23 54 views
-1

即时消息制作启动器应用程序。在教程中它使用了一个在API 17中弃用的Sliding Drawer。我可以用什么来代替这个?我尝试使用效果基本show面板从职位之一就在这里下面我可以使用什么来代替滑动抽屉

gitHubLinkhttps://github.com/umano/AndroidSlidingUpPanel

下面的链接将GitHub的。但它不会让我以我想要的方式使用它。我希望应用出现在抽屉中,而不是主要内容中。由于某种原因,第二个视图只允许我创建一个文本视图,该视图用于处理将其向上滑动。任何关于我可以用来做同样工作的其他方法的建议。它必须从底部向上滑动。感谢所有的帮助

+0

抽屉将XML片段,这样你们不能把它作为一个主要内容。它必须是活动 –

+0

滑动抽屉已弃用。我可以用什么来代替? –

+0

您正在使用哪个slidingDrawer?你可以在你的问题中提到它..我会看看.. –

回答

0

好吧,大家好吧。使用GitHub我张贴在问题中。它所做的是因为尽可能多地布置了我喜欢的布局,但只有两个孩子。我使用了一个相对布局作为我的第一个布局,其中包含一个用于我的主屏幕应用的GridView并关闭了它。然后我用另一个相对布局下面的一个textview里面,然后另一个相对布局设置与顶部(我的文本句柄的大小)80dp填充在这一个里面我有另一个gridview为我的应用程序,并关闭它的一切。

它看起来像这样

<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>