簡體   English   中英

Android 如何制作滑動菜單?

[英]Android How to make sliding menu?

目前我正在嘗試插入一種下拉式滑動菜單(不確定它是如何調用的)。 這個想法是用戶觸摸箭頭或菜單的任何區域並向上拖動以打開菜單。 但我不知道如何或在哪里可以找到這方面的教程。

在此處輸入圖片說明

檢查 github 中發布的此代碼: https://github.com/umano/AndroidSlidingUpPanel

您可以在滑動菜單中設計自己的視圖。

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

最簡單的方法是使用像https://github.com/umano/AndroidSlidingUpPanel這樣的庫

但是自從谷歌發布了CoordinatorLayoutBehavior 之后,我建議你看一看,雖然它有點新,而且很難做到。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM