相关疑难解决方法(0)

Android:导航抽屉内的2个或更多ExpandableListView

我怎么能这样做?

在此输入图像描述

导航抽屉内的两个可扩展列表视图.我试着将它添加到我的xml中,但没有运气.我想要的是只有一个滚动条的视图,但我不知道该怎么做..

这是我的导航抽屉布局:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:background="@color/Bianco"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:orientation="vertical"
        android:layout_marginLeft="16dp"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="8dp"
        android:layout_marginRight="16dp"
        android:layout_height="wrap_content">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="@string/tvHomeActions"
            android:id="@+id/textView" />

        <ExpandableListView
            android:id="@+id/elvHome"
            android:layout_width="match_parent"
            android:layout_marginTop="4dp"
            android:layout_height="300dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="@string/tvHomeNavigations"
            android:layout_marginTop="16dp"
            android:id="@+id/textView2" />

        <ExpandableListView
            android:id="@+id/elvNavigateTo"
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:layout_marginTop="4dp"  />

    </LinearLayout>

</ScrollView>
Run Code Online (Sandbox Code Playgroud)

编辑: 我想在Gmail应用程序中创建类似抽屉的东西

android expandablelistview navigation-drawer

13
推荐指数
2
解决办法
3万
查看次数

如何在导航抽屉内创建​​可扩展的listView?

我需要创建一个导航抽屉,例如 Flipkart 或 Astro 文件管理器应用程序。如何用可扩展的 listView 替换 listView?

我需要一个像这样的导航抽屉:

图像

这是我的xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
tools:context=".MainActivity">
<include
    layout="@layout/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />


<!-- This DrawerLayout has two children at the root  -->
<android.support.v4.widget.DrawerLayout
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- This LinearLayout represents the contents of the screen  -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <!-- The main content view where fragments are loaded -->
        <FrameLayout
            android:id="@+id/flContent"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />


    </LinearLayout>
    <!-- The navigation drawer that comes from the left -->
    <!-- …
Run Code Online (Sandbox Code Playgroud)

android expandablelistview navigation-drawer

5
推荐指数
1
解决办法
9665
查看次数