Answer the question
In order to leave comments, you need to log in
How to determine the height of a listview element?
The listview has a LinearLayout. It is necessary to define the full height of the LinearLayout, the elements of which are filled dynamically, as a result of which they have different heights. At the moment, the length of all elements of the list is taken to be the same, regardless of the amount of text inside.
Answer the question
In order to leave comments, you need to log in
View childView = myadapter.getView(index, null, mylistView);
childView.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
height+= childView.getMeasuredHeight();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question