Berry Jones
Berry Jones

Reputation: 1037

Expandable list increase scrolling height

I have some content that takes a half of my activity's screen view. In the bottom half, I have my expandable listview which is only 100dp high when collapsed. But, when I expand it and the list starts getting long, it only shows in the bottom half of the screen which really limits the amount of content seen.

Is there a way I can make the "frame" of the expandable list view longer when expanded (maybe have it take the entire screen?

This is the relevant style in the xml file:

// Top content...

    <ExpandableListView
        android:layout_marginTop="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/my_courses_expandable_list"
        android:groupIndicator="@android:color/transparent"
        android:dividerHeight="0dp"
        android:divider="@color/white"
    />

Upvotes: 1

Views: 423

Answers (2)

Kaushal Kishor
Kaushal Kishor

Reputation: 481

Use an ExpandableLayout like this and manage the Height of child-View or check Here (Y)

<com.kaushal.demo.ExpandableLayout
    android:id="@+id/expandablelayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="12dp">

    <TextView
        android:id="@+id/textview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"/>

    <TextView
        android:id="@+id/expandable_textview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="6dp"
        android:gravity="center"
        app:canExpand="true"/>
</com.kaushal.demo.ExpandableLayout>

Upvotes: 1

Anand S
Anand S

Reputation: 16

May use child content xml Max line=3 like that

Upvotes: 0

Related Questions