【问题标题】:Change height of sliding menu in Drawerlaout in android在Android的Drawerlayout中更改滑动菜单的高度
【发布时间】:2017-10-06 03:29:01
【问题描述】:

我正在使用带有 appcomment 库和操作栏的抽屉布局,但无法在我的按钮上执行滑动菜单

从此链接下载的抽屉布局示例程序 http://developer.android.com/training/implementing-navigation/nav-drawer.html

请问如何在活动中添加我的按钮,滑动菜单会滑过这些按钮

【问题讨论】:

    标签: android drawerlayout


    【解决方案1】:

    您可以添加一个父布局管理器,该管理器将包含抽屉布局和另一个带有您的页脚的布局管理器(底部的必需按钮)

    我尝试了一个示例:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
    
    <!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
    
    <android.support.v4.widget.DrawerLayout
        android:id="@+id/drawer_layout"
        android:layout_width="required width"
        android:layout_height="required height" >
    
        <FrameLayout
            android:id="@+id/content_frame"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    
        <ListView
            android:id="@+id/left_drawer"
            android:layout_width="240dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:background="#111"
            android:choiceMode="singleChoice"
            android:divider="@android:color/transparent"
            android:dividerHeight="0dp" />
    </android.support.v4.widget.DrawerLayout>
    
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="Footer height" >
    </LinearLayout>
    

    希望这能解决你的问题...

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-28
    • 1970-01-01
    • 2013-03-26
    • 1970-01-01
    • 1970-01-01
    • 2023-04-08
    • 2013-06-03
    相关资源
    最近更新 更多