在android中更改抽屉A中滑动菜单的高度

在android中更改抽屉A中滑动菜单的高度,android,drawerlayout,Android,Drawerlayout,我正在使用带有appcomment库和actionbar的DroperLayout,但无法在我的按钮上滑动菜单 从该链接下载的抽屉布局示例程序 请告诉我如何在活动中添加我的按钮,滑动菜单将滑动到这些按钮上您可以添加一个包含抽屉布局的父布局管理器和另一个包含页脚的布局管理器(底部的必需按钮) 我试过一个样本: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_wid

我正在使用带有appcomment库和actionbar的DroperLayout,但无法在我的按钮上滑动菜单

从该链接下载的抽屉布局示例程序


请告诉我如何在活动中添加我的按钮,滑动菜单将滑动到这些按钮上

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

我试过一个样本:

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


我希望这将解决您的问题…

不,它不起作用,给我错误。。。抽屉布局必须使用MeasureSpec.精确测量。此问题可以解决,请查看下面的链接。名为“joecks”的人给出了一个解决方案,可以通过扩展抽屉布局和覆盖onMeasure()[StackOverFlow link]()来解决这个问题。这是Android中的一个已知错误:(请参阅