0

I have an android app, that looks like this:

enter image description here

The whole view is contained within a ScrollView because if the app is rotated in landscape mode, the content does not fit the screen.

Now the part with the red marked area is a ListView, that contains the result from the previous matches. Now the issue is, that the ListView itself only shows one entry and for the rest, the user has to scroll the ListView.

But I want the ListView to always show all entries without any scrolling and only scroll the parent.

Is there any way to archive that, without creating a NestedListView class or something like that?

Zoker
  • 1,850
  • 4
  • 24
  • 43
  • One of the first things I learnt about ListView and ScrollView is that you don't have to put the first one inside the second one... probably it's better if you keep it out – Mauro Piccotti Jan 27 '18 at 17:26
  • 1
    You could try replacing the scrollview with a recyclerview. Just do multiple viewholders. One for the content above the red box, one for each set of previous matches, and whatever else below it. – Le2e410 Jan 27 '18 at 17:49

1 Answers1

0

You can solve this issue by adding android:fillViewport="true" to your ScrollView.

<ScrollView
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fillViewport="true"
  android:scrollbars="vertical">

<ListView
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:divider="@null"/>

or, In java

mScrollView.setFillViewport(true);
Prakash
  • 24
  • 1
  • 4