简体   繁体   中英

Android How to make sliding menu?

Currently I'm trying to insert a drop-down kind of sliding menu (not sure how it's called). The idea is that user touches the arrow or any area of the menu and drag upwards in order to open the menu. But I have no idea how or where can I find tutorial for this.

在此处输入图片说明

Check this code posted in github: https://github.com/umano/AndroidSlidingUpPanel .

You can design your own view in sliding menu.

<com.sothree.slidinguppaneldemo.SlidingUpPanelLayout
    android:id="@+id/sliding_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="My Content"
        android:textSize="16sp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center|top"
        android:text="Another Content"
        android:textSize="16sp" />
</com.sothree.slidinguppaneldemo.SlidingUpPanelLayout>

The easiest way would be using a library like https://github.com/umano/AndroidSlidingUpPanel

But since google released CoordinatorLayout and Behavior I would recommend you to take a look at that, although it's kinda new and much harder to do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM