Correct way of implementing SlidingDrawer in Andro

2019-04-29 07:53发布

What is the correct way of implementing Sliding functionality in android?? because android.widget.SlidingDrawer class in android has been deprecated what is the alternative for this?? please help.. Thanks

3条回答
孤傲高冷的网名
2楼-- · 2019-04-29 08:06

SlidingDrawer hides content out of the screen and allows the user to drag a handle to bring the content on screen. SlidingDrawer can be used vertically or horizontally. Xml file

 <SlidingDrawer
     android:id="@+id/drawer"
     android:layout_width="match_parent"
     android:layout_height="match_parent"

     android:handle="@+id/handle"
     android:content="@+id/content">

     <ImageView
         android:id="@id/handle"
         android:layout_width="88dip"
         android:layout_height="44dip" />

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

 </SlidingDrawer>

The size of the SlidingDrawer defines how much space the content will occupy once slid out so SlidingDrawer should usually use match_parent for both its dimensions. Inside an XML layout, SlidingDrawer must define the id of the handle and of the content:

查看更多
仙女界的扛把子
3楼-- · 2019-04-29 08:07

SlidingDrawer class was deprecated in API level 17.This class is not supported anymore. Instead of use Navigation Drawer More info

查看更多
forever°为你锁心
4楼-- · 2019-04-29 08:08

The Sliding Drawer class is deprecated for API level 17 and above. Use Navigation Drawer instead; see the Android design help page as follows:

However, you can still use Sliding Drawer below API level 17. See the following Sliding Drawer example; it's a step by step implementation process, and I bet it will help you:

查看更多
登录 后发表回答