Android 导航抽屉列表下方的安卓添加按钮
我想在导航抽屉的listview下面添加按钮,如图所示Android 导航抽屉列表下方的安卓添加按钮,android,navigation-drawer,Android,Navigation Drawer,我想在导航抽屉的listview下面添加按钮,如图所示 导航抽屉中有带有文本和复选框的自定义listview。我想在listview下面添加按钮。可能吗?请给我一个解决方案。提前谢谢。OK在阅读您的要求后,我建议您为按钮和列表使用android:layout\u alignParentTop=“true”android:layout\u over=“@id/idof your button”和android:layour-layour-alignParentTop=“true”在您的listv
导航抽屉中有带有文本和复选框的自定义listview。我想在listview下面添加按钮。可能吗?请给我一个解决方案。提前谢谢。OK在阅读您的要求后,我建议您为按钮和列表使用
android:layout\u alignParentTop=“true”
android:layout\u over=“@id/idof your button”和android:layour-layour-alignParentTop=“true”
在您的listview布局中。您必须记住,导航抽屉中最多只能有两个孩子
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/lightgray" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
>
<ListView android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="100dp"/>
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/left_drawer"
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="left"
android:background="@android:color/white"
android:orientation="vertical" >
<ListView .... here goes your navigation drawer UI/>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
按钮下方是否有其他视图,或者只有一个listview和按钮???如果您可以显示一些有帮助的布局代码。是的,listview和listview下方的两个按钮