How can i create a sliding drawer with menu items?

后端 未结 3 938
广开言路
广开言路 2020-12-08 22:56

How can I create a horizontal sliding drawer like the YouTube and Facebook app has.

\"enter

相关标签:
3条回答
  • 2020-12-08 23:40

    As far as I know it is not part of the default framework. This is the only place I can find it mention in the Android docs http://developer.android.com/design/patterns/actionbar.html and I have search quite a bit.

    This so far has been my favorite library https://bitbucket.org/verdigo/drawer/ straight forward and easy to use.

    Also pretty recently HoloEverywhere library added a drawer you can use. This one interests me since I use HoloEverywhere in most of my apps and it looks very similar to Foursquares. https://github.com/Prototik/HoloEverywhere

    0 讨论(0)
  • 2020-12-08 23:41
    How can I create a horizontal sliding drawer like the YouTube and Facebook app has.
    

    FYI: These are not sliding drawer. That is Navigation Drawer. You can create a Navigation drawer by following this sample project.

    0 讨论(0)
  • 2020-12-08 23:55

    This is a sliding menu, you can implement this by writing a custom view. There are a lot of good open source examples. I would recommend you to use this one.

    You can use it by defining this in your Layout:

    <com.slidingmenu.lib.SlidingMenu
        xmlns:sliding="http://schemas.android.com/apk/res-auto"
        android:id="@+id/slidingmenulayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        sliding:viewAbove="@layout/YOUR_ABOVE_VIEW"
        sliding:viewBehind="@layout/YOUR_BEHIND_BEHIND"
        sliding:touchModeAbove="margin|fullscreen"
        sliding:touchModeBehind="margin|fullscreen"
        sliding:behindOffset="@dimen/YOUR_OFFSET"
        sliding:behindWidth="@dimen/YOUR_WIDTH"
        sliding:behindScrollScale="@dimen/YOUR_SCALE"
        sliding:shadowDrawable="@drawable/YOUR_SHADOW"
        sliding:shadowWidth="@dimen/YOUR_SHADOW_WIDTH" />
    

    Edit:

    The Android team introduced an official sliding pattern on Google IO 2013. Read everything about it here.

    0 讨论(0)
提交回复
热议问题