I implemented it this way (the code works, so this is more the source of the idea than the solution):
package com.customcontrols; public class NoScrollListView extends ListView { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(MeasureSpec.UNSPECIFIED, 0) );
the calculation is not perfect, but it is close and still works. after that you just create a layout like this:
ScrollView com.customcontrol.NoScrollListView com.customcontrol.NoScrollListView com.customcontrol.NoScrollListView / Scrollview
ScrollView is crucial, as you can easily exhaust the borders of the screen.
PS. Calculation based on the rectum, since most of the calculation methods in ListView & Co are closed packages, which is a rather strange choice for public classes for the user interface.
source share